Assembly3 preview

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
gflorent
Posts: 49
Joined: Fri Aug 10, 2018 10:05 am
Location: France
Contact:

Re: Assembly3 preview

Post by gflorent »

The Assembly3 workbench does not seem to write to the Python console nor to be recordable as a macro.
1. New document
2. Part workbench
3. Create cube
4. Create cylinder
5. Assembly3 workbench
With these actions, the Python console displays:

Code: Select all

Python 2.7.6 (default, Mar 22 2014, 23:03:41) 
[GCC 4.8.2] on linux2
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> App.newDocument("Unnamed")
>>> App.setActiveDocument("Unnamed")
>>> App.ActiveDocument=App.getDocument("Unnamed")
>>> Gui.ActiveDocument=Gui.getDocument("Unnamed")
>>> Gui.activateWorkbench("PartWorkbench")
>>> App.ActiveDocument.addObject("Part::Box","Box")
>>> App.ActiveDocument.ActiveObject.Label = "Cube"
>>> App.ActiveDocument.recompute()
>>> Gui.SendMsgToActiveView("ViewFit")
>>> App.ActiveDocument.addObject("Part::Cylinder","Cylinder")
>>> App.ActiveDocument.ActiveObject.Label = "Cylinder"
>>> App.ActiveDocument.recompute()
>>> Gui.SendMsgToActiveView("ViewFit")
>>> Gui.activateWorkbench("Assembly3Workbench")
>>> 
All this is obviously expected. But further actions in Assembly3 (create an assembly, add parts to it etc ...) get nothing displayed in the Python console. I also tried recording as a macro but it behaves the same way.

What is the mechanism to get workbench commands to be visible and the Python console and recordable as macros? It works in some other workbenches so there must be a way ...

The reason for this question is that I am trying to figure out a way to have unit tests for Assembly3; the Python console and Macros could be of great help to write the test cases.
User avatar
fosselius
Posts: 381
Joined: Sat Apr 23, 2016 10:03 am
Contact:

Re: Assembly3 preview

Post by fosselius »

wsteffe wrote: Mon Aug 20, 2018 4:42 pm Hi fosselius, after making the link (ln -s libTKMesh.so libTKMesh.so.8)
Do a

Code: Select all

rm -rf build
mkdir build
cd build
cmake ..
You should not need to make symlinks..
Btw did you do a make install in occt?
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: Assembly3 preview

Post by wsteffe »

Hi fosselius,

I had already done what you are suggesting:
rm -Rf build
mkdir build
cd build
cmake ..

And of course I have done a make install after building OCC
The only thing is that I had changed the cmake_install_prefix so that OCC was installed in my home directory.

However the problem is not in my OCC installation. In fact I have installed other softwares (such as gmsh) which require OCC and are working well.

The problem is related with some code inside of FreeCAD that is linked with "libTK....so.8" instead of "libTK....so".
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: Assembly3 preview

Post by wsteffe »

Hi, finally I have solved the problem.

There was an old (forgotten) installation of FreeCAD (2014) in my folder "/usr/local".

The old installation has been overwritten but some libraries were in a different position and therefore not overwritten.
The old PartDesignGui.so was inside the Module directory and found before the new one.
The old one was linked with an old OCE library and looking for TK...so.8.

Now PartDesign is working but I have still a problem with Assembly module which has not been built.
The Assembly source code is in the Ext/asm3 but has not been installed.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

gflorent wrote: Mon Aug 20, 2018 5:35 pm What is the mechanism to get workbench commands to be visible and the Python console and recordable as macros? It works in some other workbenches so there must be a way ...
This requires workbench author to explicitly use FC command system. I'll add this support in 0.9 release.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

wsteffe wrote: Mon Aug 20, 2018 8:46 pm Now PartDesign is working but I have still a problem with Assembly module which has not been built.
The Assembly source code is in the Ext/asm3 but has not been installed.
Since you are building your own binary, you also need to build the SolveSpace python binding. See instructions here. BTW, you need to put asm3 directory inside Ext/freecad/.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
fosselius
Posts: 381
Joined: Sat Apr 23, 2016 10:03 am
Contact:

Re: Assembly3 preview

Post by fosselius »

Or see here for my suggested update on the build instructions: https://github.com/realthunder/FreeCAD_ ... /issues/23
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: Assembly3 preview

Post by wsteffe »

Thanks to all
I have followed the build instruction and apparently all went ok
-git cloned assembly into Ext/freecad/ and renaming it to asm3

- cd asm3
git submodule update --init slvs
git submodule update --init py_slvs

- verified that the requred sw is installed
( only libpng12-dev is not available in ubuntu 18.04 but libpng12-0 and libpng-dev are installed)

-python buildings
cd asm3/slvs
mkdir build
cd build
cmake -DBUILD_PYTHON=1 ..
make _slvs

-copied slvs.py and _slvs.so from asm3/slvs/build/src/swig/python/ to asm3/py_slvs

-I have also redone a sudo make install in the FreeCAD build directory.

All went OK apparently.
But I do not see any Assembly folder in /usr/local/Mod and there isn't any Assembly Entry in the FC Start Menu.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Assembly3 preview

Post by realthunder »

wsteffe wrote: Tue Aug 21, 2018 6:29 am Thanks to all
I have followed the build instruction and apparently all went ok
-git cloned assembly into Ext/freecad/ and renaming it to asm3
Can you show me the full path of your Ext directory? Is it in your FC installation directory? Did you find the 'freecad' directory in Ext or did you create it yourself?
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: Assembly3 preview

Post by wsteffe »

The full path (up to asm3) is:
"/home/walter/Software/FreeCad/FreeCAD/src/Ext/freecad/asm3"

"/home/walter/Software/FreeCad/FreeCAD" is the clone of https://github.com/realthunder/FreeCAD
asm3 was created doing:
cd /home/walter/Software/FreeCad/FreeCAD/src/Ext/freecad
git clone of https://github.com/realthunder/FreeCAD_assembly3 asm3

These are source directories. FC in installed in /usr/local (default path)

"/home/walter/Software/FreeCad/FreeCAD/build" was created by me as the build directory of FC.
Post Reply