How to reference document/global properties?
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
Re: How to reference document/global properties?
The question is how to access property "BearingInnerDiameter" under the group "DIMS" from the properties of the file "MyModel.FCStd" (current file) in an expression. What is the name of the freecad object that represents the file, in which any other object is inside?
-
- Posts: 339
- Joined: Mon Aug 02, 2021 6:29 am
- Location: California, USA
Re: How to reference document/global properties?
Well, I didn't even know this tool DynamicData Workbench existed until I read this post. This is another great tool from FreeCAD!
The documentation shows how to use it.
https://github.com/mwganson/DynamicData ... /README.md
I was able to make a quick file using it attached. You create the DynamicData object and then can access it just like you do a spreadsheet.
The documentation shows how to use it.
https://github.com/mwganson/DynamicData ... /README.md
I was able to make a quick file using it attached. You create the DynamicData object and then can access it just like you do a spreadsheet.
- Attachments
-
- DynamicDataExample.FCStd
- (18.52 KiB) Downloaded 18 times
Re: How to reference document/global properties?
Thanks I'll look into DynamicData. Is there a reason why Spreadsheet is so slow? It seems like it might be recomputing everything whenever something changes, rather than only the dependencies on what changed.
Re: How to reference document/global properties?
Exactly.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: How to reference document/global properties?
DynamicData isn't any different on that regard AFAIk, if you stuff that is fully independent and shouldn't trigger a recompute of some stuff you might need to create several containers/spreadsheets.
Re: How to reference document/global properties?
DynamicData seems to work when you're setting up the properties, but I can't seem to do any arithmetic on them in expressions. For instance, I setup a property of type App::PropertyLength, and if I try to use this in an expression with an offset I get "unit mismatch in minus operation":
It only seems to work if I specify the type as "PropertyFloat".
It only seems to work if I specify the type as "PropertyFloat".
- Shalmeneser
- Veteran
- Posts: 9560
- Joined: Wed Dec 23, 2020 12:04 am
- Location: Fr
Re: How to reference document/global properties?
Code: Select all
... - 1 mm
Re: How to reference document/global properties?
Well known behaviour, you must specify a unit when adding or subtracting.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/