Support for assembly2 continuing

Info about new implemented features, classes, modules or APIs. Might get technical!
User avatar
r-frank
Posts: 1984
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Support for assembly2 continuing

Postby r-frank » Mon Oct 03, 2016 8:58 am

Hello.

I know this sub-forum is mainly meant to announce things directly related to FreeCAD but i thought it would be the best place to post this.

Since a lot of discussion was going on about the future of assembly2 but no definite actions were taken i decided to
take some initiative.
I asked hamish to be invited as collaborator (which already happened, thanks hamish ...) so now i have full access to the workbench source code.

Since my programming skills in python are very weak at the moment please don't expect any big changes to happen soon.
I did merge an open pull request for support for relative paths.
My main focus was to keep the workbench alive and have an active user doing merging and commenting on the issues (if possible).

I am planning (if i have some time at my hands)
- to update the readme.md
- to correct some typos in the menus which i have found
- to set up some documentation in the wiki on github and in the wiki on freecadweb.org

At the moment there are no plans to update assembly2 to FreeCAD 0.17.
Maybe User DeepSOIC will invest some of his spare time to fork the workbench into an "assembly3" or something alike which can deal
with 0.17 part design next-files.

Roland (BPLRFE/LearnFreeCAD)
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
User avatar
easyw-fc
Posts: 609
Joined: Thu Jul 09, 2015 9:34 am

Re: Support for assembly2 continuing

Postby easyw-fc » Mon Oct 03, 2016 9:46 am

r-frank wrote:My main focus was to keep the workbench alive and have an active user doing merging and commenting on the issues (if possible).

many thanks for keeping this very useful WB alive! :D
Maurice
triplus
Posts: 4866
Joined: Mon Dec 12, 2011 4:45 pm

Re: Support for assembly2 continuing

Postby triplus » Mon Oct 03, 2016 3:29 pm

Thanks for doing it and i still hope @DeepSOIC will start where @hamish finished and will review the tools and add them to master. Likely Assembly2 WB should continue to be the name of the workbench as once C++ counterpart will start to progress again we can call it just Assembly. And maybe some tools from Aseembly2 can be added there in the future. Therefore no effort would be wasted and results would be faster to achieve as alternatives will likely happen years from now.
User avatar
easyw-fc
Posts: 609
Joined: Thu Jul 09, 2015 9:34 am

Re: Support for assembly2 continuing

Postby easyw-fc » Tue Nov 15, 2016 9:50 pm

r-frank wrote:...
I asked hamish to be invited as collaborator (which already happened, thanks hamish ...) so now i have full access to the workbench source code.
...
At the moment there are no plans to update assembly2 to FreeCAD 0.17.
Maybe User DeepSOIC will invest some of his spare time to fork the workbench into an "assembly3" or something alike which can deal
with 0.17 part design next-files.

Roland (BPLRFE/LearnFreeCAD)

Hi Roland,
following this thread
viewtopic.php?f=28&t=18513&p=144673#p144673
I started to go into FC 0.17 new Part Design and I found a way to let Assembly2 WB to load correctly a Part made with a Visible Body and made with sub Parts
this File
https://www.dropbox.com/s/s24tvyciamvmj ... FCStd?dl=0
now can be loaded in Assembly2 WB leaving the body (and the Part) visible, instead to the need to hide Body (which will hide also the Part in FC)

that is the code to modify in the file "importPart.py" of the WB @ line 43

Code: Select all

   visibleObjects = [ obj for obj in doc.Objects
                       if hasattr(obj,'ViewObject') and obj.ViewObject.isVisible()
                       and hasattr(obj,'Shape') and len(obj.Shape.Faces) > 0 and 'Body' not in obj.Name] # len(obj.Shape.Faces) > 0 to avoid sketches

I added only

Code: Select all

and 'Body' not in obj.Name

where is the latest github repo of Assembly2?
is there still under Hamish github repo?

Maurice
User avatar
microelly2
Posts: 2363
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Support for assembly2 continuing

Postby microelly2 » Tue Nov 15, 2016 10:39 pm

Thank you Maurice,
Nice to see your activity. :D
User avatar
r-frank
Posts: 1984
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Support for assembly2 continuing

Postby r-frank » Tue Nov 15, 2016 10:53 pm

Hello Maurice.

Yes the repo of hamish is still the official one.

I am still hoping to find some time to test and integrate this code here
and maybe your code via pull request.
I am also hoping to find some time to create some sort of manual/wiki for the workbench.
Is your code still compatible with 0.16 ?
Did you test that ?

Roland
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
User avatar
easyw-fc
Posts: 609
Joined: Thu Jul 09, 2015 9:34 am

Re: Support for assembly2 continuing

Postby easyw-fc » Tue Nov 15, 2016 11:08 pm

r-frank wrote:Is your code still compatible with 0.16 ?
Did you test that ?

Roland

yes, it is back compatible with FC 0.16 and FC 0.15 :D
(tested only in windows but I don't see any reason that it shouldn't work in Linux or OSX)

Maurice
User avatar
r-frank
Posts: 1984
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Support for assembly2 continuing

Postby r-frank » Wed Nov 16, 2016 9:35 pm

Hello Maurice.

Thanks for your efforts.

I was able to start some action on updating the readme.md and starting the wiki.
Next step would be to test and make pull/merge of your enhancement and Turro75's enhancement.
I will do that as soon as possible.

BTW: Spotted some typos in the tooltips of some icons and some typos in the text showing up in the task panel
when activating some commands. You don't happen to know where (in which files) i could correct these ?

Roland
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
User avatar
easyw-fc
Posts: 609
Joined: Thu Jul 09, 2015 9:34 am

Re: Support for assembly2 continuing

Postby easyw-fc » Wed Nov 16, 2016 10:13 pm

r-frank wrote:Hello Maurice.

Thanks for your efforts.

you are welcome
r-frank wrote:BTW: Spotted some typos in the tooltips of some icons and some typos in the text showing up in the task panel
when activating some commands. You don't happen to know where (in which files) i could correct these ?

Roland

if you search for:

Code: Select all

'ToolTip'

in the .py files, then you will reach the tooltips text
i.e. @ line 84 of the
%AppData%\FreeCAD\Mod\assembly2\sphericalSurfaceConstraint.py
file you get:

Code: Select all

    def GetResources(self):
        return {
            'Pixmap' : ':/assembly2/icons/sphericalSurfaceConstraint.svg',
            'MenuText': 'Add SphericalSurface Constraint',
            'ToolTip': 'Add an SphericalSurface Constraint between two objects'
            }


Maurice

PS
microelly2 wrote:Thank you Maurice,
Nice to see your activity. :D

thanks @microelly2 :D
User avatar
r-frank
Posts: 1984
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Support for assembly2 continuing

Postby r-frank » Thu Nov 17, 2016 8:30 pm

Hello Maurice.

Thanks to your hints i was able to correct a good number of typos in the tooltips, thanks for that ...
By browsing through the python-code i got a small first impression about how a more complex python project can
be designed/coded ...

I also played around with your code.
If i am not mistaken all bodies within the document have to be made invisible
and only one shape (PartDesignNext-feature) within one of the bodies has to be visible, is this correct ?
Because i opened your sample part and immediately got an error with abort upon import into
assembly2 (on Windows 7 64-bit with 0.17.8922).
So i opened your sample part in 0.17, made the body invisible, saved the file and tried again to import into
assembly2 - this time all went fine ...

At least at the moment the bodies and the PartDesignNextFeatures can be set independantly from each other.
I have the impression (after making my first 20 minutes of experience with 0.17) that a lot of things may change in
workflow until 0.17 stable is ready.

Also i get the impression that 0.16 stable will remain installed maybe quite a long time because it is stable and well documented
and at least at the moment i am feeling more comfortable with it than with 0.17.

So i would add statements in the readme and in the wiki pointing to this thread and the issue as help and
contemporary work-around for 0.17-users.
As soon as i get the feeling that 0.17 and its workflow will "stabilize" ;) i will be happy to merge the code ...

Roland
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)