Page 5 of 6

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Wed Mar 15, 2023 10:34 pm
by freedman
OK, Git now has BodyBuilder4.1, some instructions, and an image of the dialog menus. I will do a couple videos of the basics.
https://github.com/Freedman-CB1/BodyBuilder

Thanks, edwilliams16 for the code that allows me to get Body selections from a 3D face selection.
Thanks, dtay for the matrix idea.

Here is an earlier discussion:
viewtopic.php?t=75597&start=10

Thanks all

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Sat Mar 18, 2023 8:38 pm
by freedman
I have made a few changes to BodyBuilder, all in the GUI and object selection area. Version 4.3
https://github.com/Freedman-CB1/BodyBuilder

I also did some testing with Clones and they seem to work just like a Body. That capability can help decrease file size and adds a lot of structure to a model with many identical shapes i.e. if you want to design a deck, all the deck plates could be clones so they can be copies but still be individually edited if needed.

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Sat Mar 18, 2023 9:10 pm
by app4soft
freedman wrote: Sat Mar 18, 2023 8:38 pm I have made a few changes to BodyBuilder, all in the GUI and object selection area. Version 4.3
https://github.com/Freedman-CB1/BodyBuilder
I just got an error when tried to run it with latest FreeCAD 0.21.0 weekly build:

Code: Select all

23:35:22  <class 'SyntaxError'>: ('unterminated string literal (detected at line 14)', ('/home/user/.FreeCAD/Macro/BodyBuilder.FCMacro', 14, 16, '__Requires__ = "Built on 21.', 14, 16))
There was no such issue with previous BodyBuilder 4.1.

N.B. Maybe it would be good to add extension to macro file name ("BodyBuilder.FCMacro") and not change that filename on each update.

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Sat Mar 18, 2023 9:58 pm
by freedman
I fixed it, forgot to commit, again. They should put the commit button at the top of page.
Thanks
Maybe it would be good to add extension to macro file name ("BodyBuilder.FCMacro") and not change that filename on each update.
I'm new to Git so I don't know how the updating is supposed to keep up with new version vs the old. I removed the rev number from the name so the file is always BodyBuilder. As I rev it with small changes the title bar is my way of showing the rev #. I'm not sure what the user should be doing if they want an old version. I have put little effort in Git, will do some reading.

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Sat Mar 18, 2023 11:13 pm
by app4soft
freedman wrote: Sat Mar 18, 2023 9:58 pm I fixed it, forgot to commit, again. They should put the commit button at the top of page.
Thanks
Maybe it would be good to add extension to macro file name ("BodyBuilder.FCMacro") and not change that filename on each update.
I'm new to Git so I don't know how the updating is supposed to keep up with new version vs the old. I removed the rev number from the name so the file is always BodyBuilder. As I rev it with small changes the title bar is my way of showing the rev #. I'm not sure what the user should be doing if they want an old version. I have put little effort in Git, will do some reading.
Thanks for hotfix! You may just edit macro file on GitHub like in text editor: https://docs.github.com/en/repositories ... ting-files

Also, I just created a pull request to fix extension name (*.macro :arrow: *.FCMacro): You may just merge it now to fix extension (but use "Squash and merge" in a "Merge pull request" button drop-down menu):
.
github-merge.png
github-merge.png (17.1 KiB) Viewed 1296 times

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Wed Mar 22, 2023 6:40 am
by freedman
After following this thread:
"The need for a default assembly workbench"
viewtopic.php?t=76799

I believe this could be a possible new Gui to code-up for PartDesign. Here is a procedure to make an assembly connection:

1) In the Tree, Select a Body and CTL select a Sketch (obviously from a different body). Click the new make attachment icon.

With the assembly engine running the Body origin would be aligned to the selected Sketch origin immediately. The next issue is rotating the attached Body so the user gets what they want.

2) Add 2 icons +View and -View, as the icons are clicked the Body will change to different rotations. The user would click these until they get the one they want. Once set the data will be saved in Properties.
Edit: If parts are designed using standard planes there are only approx. 12 rotation possibilities, all at 90 degree increments.

3)If the user needs some sort of offset there will be custom Properties in the property panel. This is where they do adjustments.

This is the simplest Assembly I can think of, so far....

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Thu Mar 23, 2023 12:57 pm
by demonlibra
Is there are a simply demonstration video from begin how to use this macro?

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Thu Mar 23, 2023 11:12 pm
by freedman
Maybe this will get you started. I turned the origins on so you can see the objects base placement. So, two Bodies placed randomly, I click on To Positioning and then to Edit Binding. I click the cylinder and then a sketch ( in another Body) to create a binding. I then show how to click the cylinder and remove the binding and properties, and then apply them once again. Then change to Positioning and move the cylinder around with binding constraints. Then switch the dialog back to it's minimal state.

As long as the macro runs the objects will be bound together.

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Fri Mar 24, 2023 4:22 am
by Lonfor
freedman wrote: Thu Mar 23, 2023 11:12 pm Maybe this will get you started. I turned the origins on so you can see the objects base placement.
If you can achieve that instead of bodies to have external files (their file name in the tree of course) for manipulation with "BodyBuilder", a statue will be erected in your honor. :)

Re: Releasing "BodyBuilder", a PartDesign macro for assembling bodies

Posted: Fri Mar 24, 2023 7:29 am
by freedman
Lonfor, that would be something for a more powerful assembler. Darn I really like the armor with the 3D guys on it.
My goals are like this:

1) Make BodyBuilder (BB) icon pop-up driven.

2) Make the BB core run as a resident macro i.e. the portion of the code (about 30 python lines) that keep objects attached. I tried this and it worked but I need more testing. BB only runs when required by callbacks so it's very low overhead. I did something similar here.
3) I want to get to sketch based manipulation. Adding a sketch with geometry that is read by BB, this will feed data to the Body Positioning variables. For instance; you draw a sketch of a circle, then an angled line with a circle on the end; when ran the Body (with all the attachments) would move the line angle and distance while rotating. The circle sizes would be the rotation speed, something like that. I think sketches would be perfect for the source of 2D sims.