Assembly 4 workbench

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
youen
Posts: 62
Joined: Sun May 19, 2019 7:32 pm

Re: Assembly 4 workbench

Post by youen »

Hello, I'm using a lot of variant links to place bolts in my assembly, and it just stopped working (can't add more links) with these messages:

Code: Select all

100 temporary variant documents are already in use, not creating a new one.
Traceback (most recent call last):
File "/home/youen/.local/share/FreeCAD/Mod/Assembly4/./variantLinkCmd.py", line 209, in onCreateLink
     variantLink.Type = 'Asm4::VariantLink'
AttributeError: 'FeaturePython' object has no attribute 'Type'
Does this mean I can't make more than 100 variant links? Is there a workaround?

For the context, I use variant links for bolts because each bolt is a sub-assembly containing screw, washers and nut, and there is a variable to specify the distance between washers. Maybe there is a better option to efficiently place bolts in an assembly?
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

youen wrote: Fri Oct 28, 2022 7:17 pm Does this mean I can't make more than 100 variant links? Is there a workaround?
yes, this is a self-imposed limit because I didn't know how FreeCAD would behave with thousands of variant links. You can manually set that limit higher in the file Asm4_objects, lines 91-93 (I realise it's crappy hard-coded) :

Code: Select all

        while i<100 and tmpDocName+str(i) in App.listDocuments():
            i += 1
        if i<100:
For the context, I use variant links for bolts because each bolt is a sub-assembly containing screw, washers and nut, and there is a variable to specify the distance between washers. Maybe there is a better option to efficiently place bolts in an assembly?
depends ... if you have many identical groups of fasteners with the same offset, I'd rather suggest – because it's "cheaper" in resources – to make them in the Parts group and link them from there into the assembly. If each bolt-assembly has different offsets, then variant links are a good option.
try the Assembly4 workbench for FreCAD — tutorials here and here
youen
Posts: 62
Joined: Sun May 19, 2019 7:32 pm

Re: Assembly 4 workbench

Post by youen »

Zolko wrote: Fri Oct 28, 2022 10:09 pm yes, this is a self-imposed limit because I didn't know how FreeCAD would behave with thousands of variant links. You can manually set that limit higher in the file Asm4_objects, lines 91-93 (I realise it's crappy hard-coded) :
Thanks for the informations! If it helps, I did not notice any performance issue or other problem until I reached the limit.

Zolko wrote: Fri Oct 28, 2022 10:09 pm if you have many identical groups of fasteners with the same offset, I'd rather suggest – because it's "cheaper" in resources – to make them in the Parts group and link them from there into the assembly. If each bolt-assembly has different offsets, then variant links are a good option.
Yes, that makes sense. I have both cases (some identical bolts repeated a lot, and some cases with unique bolts). So I'll try a mix of variant and normal links, and this should hopefully save enough variant links to finish the assembly.
definitiv
Posts: 2
Joined: Sun Nov 06, 2022 7:06 pm
Contact:

Re: Assembly 4 workbench

Post by definitiv »

Followed the procedure of the "Asm4_Tutorial2". But the parts i inserted transform on Variable change. I had the same problem 1 year ago, but found no solution.

What i did:
- All 4 parts have a lcs
- Each of the 4 red lines from the master sketch has a lcs attached to it.
- The parts are inserted and attached each to one of the red lines.
-> The lines move correct, but the parts are jumping around.

The Video shows whats happening. It looks a bit wierd because i compressed it quite a bit.

Doese somebody know how i prevent this?
Attachments
Animation_compressed.gif
Animation_compressed.gif (785.7 KiB) Viewed 5325 times
Last edited by definitiv on Sun Nov 06, 2022 7:42 pm, edited 2 times in total.
User avatar
ppemawm
Veteran
Posts: 1240
Joined: Fri May 17, 2013 3:54 pm
Location: New York NY USA

Re: Assembly 4 workbench

Post by ppemawm »

definitiv wrote: Sun Nov 06, 2022 7:40 pm Doese somebody know how i prevent this?
This is known problem with the sketch solver. The edge and vertices numbering gets changed as the angle changes which affects the LCS attachment.

You'll have to do some experimenting.
Try the following:
1. Several simpler sketches instead of one complex master sketch
2. Make sure the sketches are fully constrained. Use different methods of constraints.
3. Different attachment modes for the LCS.
4. The variable angle changes should be small.

It is difficult to give you a definitive answer without the file.
"It is a poor workman who blames his tools..." ;)
chrisb
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Assembly 4 workbench

Post by chrisb »

If ever possible, it is more stable to turn whole sketches than to let the Sketcher solve a sketch with a turning part.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
definitiv
Posts: 2
Joined: Sun Nov 06, 2022 7:06 pm
Contact:

Re: Assembly 4 workbench

Post by definitiv »

@ppemawm @chrisb Thank you for your answers!

I ditched the sketch completly and added the formaular for the angle direcly into the lcs... and it works! :D
Grawp
Posts: 45
Joined: Sat Mar 03, 2018 9:34 am

Re: Assembly 4 workbench

Post by Grawp »

Hello. I'm looking for an example how to do an assembly in a middle of a part creation. Is such thing even possible with Asm4? I'll try giving a simple explanation with an example:

I have a model of a box and various electromechanical components which goes inside. Components must have specific placements regarding each other and of the box. For example a leaver must be placed on a servomotor and the servomotor must be placed so the leaver is poking outside of the box. This is all so far easy to be done in Asm4.

But then I need to continue with shaping/designing the box part. A cutout must be created where the leaver is poking out. Mounting holes must be drilled on exact places where some of the components ended up. Support columns, brackets, guides, aligning stuff must be created etc... all depending on the assembly.

I haven't found anything like that done with Asm4. Is it even possible? I've seen only final assemblies be done so far which is worthless except for having nice visualization when you don't/can't use it to drive your design further.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

Grawp wrote: Wed Dec 07, 2022 11:05 pm Is such thing even possible with Asm4 ? ... which is worthless ...
I suggest you take general courses in human interaction optimization.
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
rmn_hr
Posts: 110
Joined: Sun Jun 26, 2022 7:54 pm

Re: Assembly 4 workbench

Post by rmn_hr »

Grawp wrote: Wed Dec 07, 2022 11:05 pm
I haven't found anything like that done with Asm4. Is it even possible? I've seen only final assemblies be done so far which is worthless except for having nice visualization when you don't/can't use it to drive your design further.
Have you ever seen the Asm4-tutorials by Mads Leth Danielsen -> https://www.youtube.com/channel/UCpdgfE ... g9Q/videos

His scissor lift (an amimated assembly) is a simple example how to build up an assembly from scratch.
https://www.youtube.com/watch?v=XBmkm9ewhRU

He starts with a sketch only. Finishing the part used - one arm is inserted in the assembly four times - is done later. Dimensions of this part are changed several times - by trial and error with some breakdowns of the assembly. But at least he ends up with a moving (simple) scissor-lift

Also his other tutorials are showing that one can adopt and add nearly everything during design-process.
Positioning of LCS is crucial - at least the concept of using a master sketch is robust.
This basic-sketch is stable in most cases and therefore not exposed to toponaming problem.

In your case placing parts on a basic layout - a master sketch at all - can be a way.
Finishing parts and housing on the fly is possible any time.
My workflow: create single components in PartDesign and arrange them with Zolko's Assembly4
(https://github.com/Zolko-123/FreeCAD_Assembly4 )

FreeCAD works pretty well and stable for me !! :)
Hymn of Praise valid again since FreeCAD 0.22.35449
Post Reply