Assembly 4 workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Assembly 4 workbench
How can I get the current asm4 configuration name with python?
Re: Assembly 4 workbench
I don't think you can. Configurations are read from the spreadsheet and applied, but there is no trace of it once it's done
Re: Assembly 4 workbench
Oh. I see.
My idea was to use the name of the configuration in the BOM. So it generates a different BOM regarding the configuration in use.
So, if I have 2 configurations named ConfigA and ConfigB
I would end up having BOM_ConfigA and BOM_ConfigB.
This is the case when you would have hidden parts on different configurations.
My idea was to use the name of the configuration in the BOM. So it generates a different BOM regarding the configuration in use.
So, if I have 2 configurations named ConfigA and ConfigB
I would end up having BOM_ConfigA and BOM_ConfigB.
This is the case when you would have hidden parts on different configurations.
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Assembly 4 workbench
Is asm4 configuration different from the built-in configuration tables functionality? https://wiki.freecadweb.org/Spreadsheet ... ion_tables
Re: Assembly 4 workbench
yes, it's easier.adrianinsaval wrote: ↑Wed Sep 28, 2022 5:35 pm Is asm4 configuration different from the built-in configuration tables functionality?
Re: Assembly 4 workbench
I believe it is the same thing. But Asm4 sets the spreadsheet that is currently active, somehow.adrianinsaval wrote: ↑Wed Sep 28, 2022 5:35 pm Is asm4 configuration different from the built-in configuration tables functionality? https://wiki.freecadweb.org/Spreadsheet ... ion_tables
And this is what I was looking for, a way to detect which configuration is set.
The Model could have a property called Configuration, and then the same list could appear there.
Then someone that wants to detect the configuration that is in use, could find it there.
But this is my naive opinion.
Re: Assembly 4 workbench
That's an endless rabbit hole...
Your proposal is easy to do, but what happens when you load a configuration and do some manual changes after that (hide/unhide parts)?
The variable will still show the last loaded configuration name, which probably is not related to the actual model.
When I added the configurations, I saw placements in my head, a preparation to normal and exploded states that I never had time to finish.
Hidden state was added later as far as I recall.
Re: Assembly 4 workbench
Ok makes sense. It could have at least a property that the user cannot change showing the name of the current configuration.
This way it is easier for the user to remember what is in use, and it is helpful in the case of needing to overwrite the current configuration.
Also, Zolko, when opening the Configurations Panel, the current configuration could be Highlighted by default.
This way it is easier for the user to remember what is in use, and it is helpful in the case of needing to overwrite the current configuration.
Re: Assembly 4 workbench
there is no "current configuration " : a configuration is like a bookmark, a state that you can set and restore.
Re: Assembly 4 workbench
I see, it would be useful to have the record of the last clicked configuration then.
I am thinking that I can have 2 assemblies for the same set of parts.
For instance, The Transformers, with the same set of parts, can be a Car or a Humanoid-Robot.
Configurations allow that. And having a record of the last used/selected configuration can be useful too in the case where set o parts are not used in one of the configurations.
I am thinking that I can have 2 assemblies for the same set of parts.
For instance, The Transformers, with the same set of parts, can be a Car or a Humanoid-Robot.
Configurations allow that. And having a record of the last used/selected configuration can be useful too in the case where set o parts are not used in one of the configurations.