If you are not creating document objects, then it can sensible to only use dialogs. But if you are creating document objects you definitely want to base them on feature python.
Here are a few reasons:
To have a custom icon in the tree is very easy, just return the string in xpm format from getIcon() in the view provider class.
Serialization is already taken care of automatically for the FreeCAD property types.
Users may easily edit the properties in the property view without going back to the workbench to run the dialog again.
Properties may be bound to other properties, spreadsheet aliases, sketcher constraints, allowing for more parametric models.
No need to reinvent the wheel with slots, signals, and the like when the feature python object gives you all this already for responding to property changes.
Why would I use FeaturePython
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Why would I use FeaturePython
Thanks Mark, that's a very useful listTheMarkster wrote: ↑Sun Jan 23, 2022 9:09 pm If you are not creating document objects, then it can sensible to only use dialogs. But if you are creating document objects you definitely want to base them on feature python.
Here are a few reasons:
To have a custom icon in the tree is very easy, just return the string in xpm format from getIcon() in the view provider class.
Serialization is already taken care of automatically for the FreeCAD property types.
Users may easily edit the properties in the property view without going back to the workbench to run the dialog again.
Properties may be bound to other properties, spreadsheet aliases, sketcher constraints, allowing for more parametric models.
No need to reinvent the wheel with slots, signals, and the like when the feature python object gives you all this already for responding to property changes.