assembling assemblies

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
afb
Posts: 3
Joined: Sun Nov 27, 2016 9:10 pm

assembling assemblies

Post by afb »

I'm looking for some pointers.
I have created all my parts and exported as step files.
These step files then imported to a new document and put in place to create my 'assembly'
I have installed assembly2 and stumbled thru using the constraints but was only successful with 'add circle edge constraint between 2 objects'
at this stage my assembly was easy enough to position each part without constraints.
My next challenge is to join 2 of these assemblies. Is product the correct term?
Can anyone point me in the right direction or link to a tutorial on how to assemble or clone assemblies to create a new assembly?

Regards

OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6707 (Git)
Build type: None
Branch: releases/FreeCAD-0-16
Hash: 5465bc47c95db45e0be85dc0e2872419efadce0f
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
User avatar
r-frank
Veteran
Posts: 2180
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: assembling assemblies

Post by r-frank »

Hello afb.

At the moment, there is no possibility to import an assembly2-file into assembly2.
I know that assembly2 supports grouping constraints but i didn't try yet
if you can group imported parts.

Maybe that would be option for you ?

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
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: assembling assemblies

Post by easyw-fc »

afb wrote:My next challenge is to join 2 of these assemblies. Is product the correct term?
r-frank wrote: At the moment, there is no possibility to import an assembly2-file into assembly2.
if you save an assembly2 file as FCStd file, then you can create a new assembly using this assembly2 file as subassembly and import the sub-assembly in the same way you import a part.
When you made modification to sub parts of sub-assembly, you need to refresh and save your sub-assembly file to see the modifications in the top level assembly.
here some tips
viewtopic.php?f=9&t=17742&p=146250#p146230
paul18 wrote: In the first CAD (see first picture), I have dozens of sub-parts, including screws, bolts, parts, motors, springs and so on; The trick I find is to create as many sub-assemblies as I can in order to enlight the solver.
User avatar
r-frank
Veteran
Posts: 2180
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: assembling assemblies

Post by r-frank »

easyw-fc wrote:if you save an assembly2 file as FCStd file, then you can create a new assembly using this assembly2 file as subassembly and import the sub-assembly in the same way you import a part.
I did try with 0.16 stable and assembly2 that way and it did not work.
That's why i wrote above.
Paul18 did not write exactly how he did the sub-assemblies (all in one document or other way ...)

Perhaps i will find time this evening to investigate more ...
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
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: assembling assemblies

Post by easyw-fc »

r-frank wrote: I did try with 0.16 stable and assembly2 that way and it did not work.
That's why i wrote above.
I tested before posting in FC 0.16 and 0.17 and it works for me...
here a simple sub-assembly example
(file originally in c:\test)
ass-a-2.FCStd
(7.74 KiB) Downloaded 68 times
cut.FCStd
(6.75 KiB) Downloaded 54 times
p1.FCStd
(4.78 KiB) Downloaded 57 times
p2.FCStd
(6.12 KiB) Downloaded 52 times
sub-a-1.FCStd
(6.16 KiB) Downloaded 57 times

Code: Select all

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

Code: Select all

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9093 (Git)
Build type: Release
Branch: master
Hash: 1855c80f360b198957e9be51eeff693d5c05eb85
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
User avatar
r-frank
Veteran
Posts: 2180
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: assembling assemblies

Post by r-frank »

Hello Maurice.

Not with the current master of assembly2.
Trying to import your file sub-a-1.fcstd results in an empty imported part.
And I get the error

Code: Select all

Running the Python command 'importPart' failed:
Traceback (most recent call last):
  File "C:\Users\Roland Frank\AppData\Roaming\FreeCAD\Mod\assembly2\importPart.py", line 135, in Activated
    importedObject = importPart( filename )
  File "C:\Users\Roland Frank\AppData\Roaming\FreeCAD\Mod\assembly2\importPart.py", line 55, in importPart
    obj_to_copy.Shape =  muxObjects(doc)
  File "C:\Users\Roland Frank\AppData\Roaming\FreeCAD\Mod\assembly2\muxAssembly.py", line 13, in muxObjects
    for obj in doc.getSelection():

'App.Document' object has no attribute 'getSelection
Maybe it has something to do with your local commits ?

I will try with your github-fork ...

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
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: assembling assemblies

Post by easyw-fc »

r-frank wrote:Hello Maurice.

Not with the current master of assembly2.
Trying to import your file sub-a-1.fcstd results in an empty imported part.
And I get the error
Hi Roland... I tried with the assembly2 version installed with the github 'addon installer' (after having removed my fork) and I can import all sub assembly and assembly models with no errors...
that's really strange
I tried also adding space in DIR name but the loading went fine too...

you could try to force a verbose debug output commenting line 34 in assembly2lib.py

Code: Select all

#debugPrint.level = 4 if hasattr(os,'uname') and os.uname()[1].startswith('antoine') else 2 #maui
debugPrint.level = 4 #maui to debug
and forcing debug level to 4

Maurice
paul18
Posts: 202
Joined: Sat Jul 19, 2014 7:44 pm
Location: France

Re: assembling assemblies

Post by paul18 »

Hi

It still works for me (have a look in the attachment); I'm under FreeCAD 0.16 with the latest Assembly2 release (installed in ppa)

Hope it helps

Paul
Attachments
sub_assembly_examples.7z
(93.71 KiB) Downloaded 48 times
User avatar
r-frank
Veteran
Posts: 2180
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: assembling assemblies

Post by r-frank »

OK, you win ... :)

After completely deleting assembly2-directory and its contents and re-installing via addons-installer
everything now works fine with importing assemblies ..
I guess just updating is a bad idea on windows, deleting and re-installing seems to be the better idea.

@easyw-fc:
I am not a very good programmer, but if i understand correctly, applying your commit
7563b8b24d626b26e1d87b8298fbe457782cff23 of June 12, 2016
and all commits from 30 November (except the first commit (aligning to main repo))
to the master branch of assembly2 would bring the code to most possible recent level ?

I would also merge the actual changes for the mux behaviour ...

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
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: assembling assemblies

Post by sgrogan »

r-frank wrote:I guess just updating is a bad idea on windows, deleting and re-installing seems to be the better idea.
for me deleting all the .pyc files after an update has worked so far.
"fight the good fight"
Post Reply