Freecad collision detection

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!
User avatar
kwahoo
Posts: 680
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Freecad collision detection

Post by kwahoo »

bambuko wrote: Sat Dec 04, 2021 6:37 pm How would it handle the "solve constraints" command needed after every single step in my assembly?
If you take look at my first script, there is a line that triggers solving Assembly3:

Code: Select all

Gui.runCommand('asm3CmdSolve',0)
User avatar
bambuko
Veteran
Posts: 2169
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Freecad collision detection

Post by bambuko »

kwahoo wrote: Sat Dec 04, 2021 6:42 pm ...If you take look at my first script...
It's getting late and I am tired :oops:
sorry and thank you!
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Freecad collision detection

Post by TheMarkster »

bambuko wrote: Sat Dec 04, 2021 6:22 pm
TheMarkster wrote: Sat Dec 04, 2021 5:26 pm ...Animator macro...
Thank you,
I animate my assemblies by changing placement angle of one single part/body along selected axis (the rest of the assembly is constrained to this particular part/body) .
How would it handle the "solve constraints" command needed after every single step in my assembly?
I will try your macro on one of my test models.
The macro only animates the properties, which also can include spreadsheet aliases and named sketcher constraints. It knows nothing of "solve constraints". Is this an assembly4 command? If so, perhaps it could be added to the macro code, along with a boolean property, such as "SolveConstraints" that would, if true, tell the macro to run that code each step through the loop. Let me know if you edit the code so I can consider adding it to master so other users can also benefit.
User avatar
bambuko
Veteran
Posts: 2169
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Freecad collision detection

Post by bambuko »

TheMarkster wrote: Sat Dec 04, 2021 7:09 pm It knows nothing of "solve constraints". Is this an assembly4 command? If so, perhaps it could be added to the macro code, along with a boolean property, such as "SolveConstraints" that would, if true, tell the macro to run that code each step through the loop...
It is Assembly 3.
I can either animate it directly through changing placement property (so I guess it could be used this way) or...
I also animate some, by changing dimensional constraints in the skeleton sketches (to which mechanism is constrained).
At the moment I use "dd" (DynamicData) for it, but it could use cell in a spreadsheet or anything similar.
I like "dd" very much for what I do (personal preference?)

as kwahoo explained in his post what it needs is:

Code: Select all

Gui.runCommand('asm3CmdSolve',0)
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Freecad collision detection

Post by TheMarkster »

Okay, thanks. I updated the macro (version 0.2021.12.04) to now have boolean properties that, if set to true, tell the macro to execute the assembly workbench solve command each step through the loop. Three new properties, one each for A2Plus, Assembly3, and Assembly4. You must open the workbench at least once during the current session or else the solver won't be available and the macro will fail.
Snip macro screenshot-536d1b.png
Snip macro screenshot-536d1b.png (78.34 KiB) Viewed 1050 times
User avatar
bambuko
Veteran
Posts: 2169
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Freecad collision detection

Post by bambuko »

TheMarkster wrote: Sun Dec 05, 2021 2:34 am Okay, thanks. I updated the macro (version 0.2021.12.04)...
Thank you!
Downloaded. Will have a play with it.
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
Post Reply