Is there a workaround for Object Property names with a minus sign?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Is there a workaround for Object Property names with a minus sign?

Post by dan-miel »

I’m adding Techdraw information into a FreeCAD Object. When I try to add some of the properties with minus signs in the name, such as FC-DATE and FC-Title, I get an error for an improper name is there a work around so I can keep the names matched. At the moment I’m thinking of a rewrite using dictionaries.
Dan
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Is there a workaround for Object Property names with a minus sign?

Post by onekk »

I don't think as sometime properties are used as "object properties" so you could retrieve their value in code as:

Code: Select all

obj.property
You could easily see what problem will arise with a minus sign in the name.


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/
Post Reply