Assembly 4 workbench

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
bambuko
Veteran
Posts: 2169
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Assembly 4 workbench

Post by bambuko »

Kunda1 wrote: Thu Sep 24, 2020 5:12 pm Post your About info
sorry, my bad :oops:
Have updated my original post
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

bambuko wrote: Thu Sep 24, 2020 4:32 pm When I fire FreeCAD and select Assembly 4 workbench, I get following reports:

Code: Select all

17:27:03  Unknown command 'Part_Import'
17:27:03  Unknown command 'Asm4_insertRod'
17:27:03  Unknown command 'Asm4_FSparameters'
it was a bug, should be fixed now, please update the workbench to 0.9.9
try the Assembly4 workbench for FreCAD — tutorials here and here
louisgag
Posts: 75
Joined: Fri Jan 17, 2020 9:59 am

Re: Assembly 4 workbench

Post by louisgag »

Fixed for me. Thank you.
User avatar
bambuko
Veteran
Posts: 2169
Joined: Thu Oct 24, 2019 12:53 pm
Location: UK, England, North Devon

Re: Assembly 4 workbench

Post by bambuko »

Zolko wrote: Thu Sep 24, 2020 9:33 pm ...it was a bug, should be fixed now, please update the workbench to 0.9.9
Thank you, updated and OK
I am using Link branch and Assembly3
you can also download ... and try it here
excellent Assembly3 tutorials here
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Assembly 4 workbench

Post by Kunda1 »

Thanks for fix, Zolko!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly 4 workbench

Post by catman »

The following is a quote from FreeCAD wiki on Expressions:
There is no concept of global variables in FreeCAD at the moment. Instead, arbitrary variables can be defined as cells in a spreadsheet using the Spreadsheet workbench...
I think this is not true any more.
Assembly4's variable feature in my view is exactly that.


Its not really global, however, because Its available only to Assembly4 parts. But I found that this feature even works when I move the variables folder out of the Assembly4 model and delete the remains of the Assembly4 model. The image below is an example of a very simple and intuitive-to-use parametric FreeCAD part
VariablesForAll.png
VariablesForAll.png (85.67 KiB) Viewed 2633 times
FreeCAD parametric part with Assembly4's Variable feature

Looking into the Python code files, it seems to me that the variable code is in the single file 'VariablesLib.py'. If that is not really closely connected to other Assembly4 code, I am thinking whether it would be an idea to move the variable part into a separate workbench?
That way all other FreeCAD documents could greatly benefit from this feature.

However, as its code from @zolko, I would like to ask whether he thought about such a thing before or if there is something that would prevent that on a conceptual level.
project4
Posts: 237
Joined: Fri Jul 12, 2013 12:53 pm

Re: Assembly 4 workbench

Post by project4 »

I've asked zolko a while ago how do I access variables from sub-sub-links and his answer was that it's impossible to set such variables, only read them...
His proposal was to create a separate document, which will be linked to all other documents that want to use it.
It's very much the same as having a spreadsheet that will be linked to other documents.

Apparently there is no real "global" variable solution after all.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly 4 workbench

Post by Zolko »

catman wrote: Tue Sep 29, 2020 12:22 pm However, as its code from @zolko, I would like to ask whether he thought about such a thing before or if there is something that would prevent that on a conceptual level.
1) it's open/free source, you can copy it without my permission

2) you can create variables in pure parts: in the Assembly4 WB, create a new document, a new part, select the new part, and choose "Add Variable" and it will create the Variables placeholder to have variables in the part, which you can then use with whatever FreeCAD tool you want. Doesn't work with Bodies because they cannot contain such variables. Hum ... thinking about this ... would that make sense to create the Variables in the same document but outside a Body if no Part is selected ? EDIT: bah, I did it all the same: you can now create the Variables in any document.

3) there is already the "Dynamic Data" WB which also does that already (I think)

Therefore I'd not advise you to create a specific WB for variables.
Last edited by Zolko on Tue Sep 29, 2020 1:31 pm, edited 1 time in total.
try the Assembly4 workbench for FreCAD — tutorials here and here
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly 4 workbench

Post by catman »

project4 wrote: Tue Sep 29, 2020 12:28 pm I've asked zolko a while ago how do I access variables from sub-sub-links and his answer was that it's impossible to set such variables, only read them...
I did not think about referencing the variables from other files, just from the own document, mainly because a spreadsheet is a lot more cumbersome to use. For linking cross-document variables the spreadsheet allows to adds documentation more easily, maybe its better suited for this kind of use, indeed.

Very interesting. I would have expected that they could be addressed in expressions like any other object in the document:
documentName.Variables.<<myVariable>>
Thanks for that info.
catman
Posts: 412
Joined: Fri Jan 11, 2019 10:42 pm

Re: Assembly 4 workbench

Post by catman »

Zolko wrote: Tue Sep 29, 2020 1:06 pm 2) you can create variables in pure parts: in the Assembly4 WB, create a new document, a new part, select the new part, and choose "Add Variable" and it will create the Variables placeholder to have variables in the part, which you can then use with whatever FreeCAD tool you want. Doesn't work with Bodies because they cannot contain such variables. Hum ... thinking about this ... would that make sense to create the Variables in the same document but outside a Body if no Part is selected ?
Works fine. I am not sure why the part selection is relevant. I think it does make sense to have one Variable leaf at the trees root level to contain all user modifiable parmeters for a document - especially if there are multiple bodies in it.
Zolko wrote: Tue Sep 29, 2020 1:06 pm 3) there is already the "Dynamic Data" WB which also does that already (I think)
good point. Have not really checked that one out.
Zolko wrote: Tue Sep 29, 2020 1:06 pm Therefore I'd not advise you to create a specific WB for variables.
Thanks for the fast feedback.
Post Reply