Problems saving python object property

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
richi
Posts: 11
Joined: Thu Jul 06, 2017 10:49 pm

Problems saving python object property

Post by richi »

Hello all. I'm developing a FreeCAD workbench for optical design, where the objects are of the type Part::FeaturePython.

I added some custom properties to the objects, but I'm seeing some weird behaviour when reloading the objects from a file:
  • One of the properties is of type App::PropertyPrecision that is initialized to receive positive and negative numbers. As soon as the object is created the property works fine, but when the file is reopened, the property will only accept positive numbers.
  • The other problem is similar, but in this case the property is of type App::PropertyQuantity , where I'm assigning a custom units of 1/mm. Again in this case, when the object is created the property works fine, but when the file is reopened, the property looses the unit (only the number appears).
Any idea of what could be going on?

I have tested the same code in:

OS: Pop!_OS 21.04 (MATE/mate)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.9.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: Spanish/Colombia (es_CO)

and in:

OS: Debian GNU/Linux 10 (buster) (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.25261 (Git)
Build type: Unknown
Branch: master
Hash: 138144d88e0c2310ac710ffcf574c4d2ca66ba6a
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Spanish/Colombia (es_CO)

With the same results.
Post Reply