I am not sure I fully understand your idea. You want to add a geometry extension to an geometry object, so that you can tell whether a geometry was added by the user or by your method?paullee wrote: ↑Tue May 14, 2019 4:25 pm Hi, your branch compiled in Feb, just go through the steps and it works as expected ! Thanks
Testing in Sketcher::SketchObjectPython and have some thought see if you can offer some comment:-
SketchObjectPython - Python generated geometries or User added geometries
Using SketchObjectPython object, the def execute() add some geometries to the object. User can 'manually' add geometry also.
Thinking to add a 'tag' for those geometries added by inherent method of the SketchObjectPython object, to distinguish those added by user.
Not sure what exactly each of below mean, wonder if GeometryBoolExtension or GeometryStringExtension ( "autoGenerated", Geometry ) or ( "userAdded", Geometry )
Thanks for any idea.
- GeometryIntExtension (long int/Py::Long),
- GeometryDoubleExtension (double/Py::Float),
- GeometryBoolExtension(Bool/Py::Boolean),
- GeometryStringExtension(std::string/Py::String).
For this I would use a GeometryBoolExtension, because it is the simplest. You do not need to compare strings.
Code: Select all
geo0.setExtension(Part.GeometryBoolExtension(True,"geocoolness"))
My advice is to always give extensions a name. You may have several extensions of type boolean.
Some of the geometries will have the boolean extension "geocoolness" and others won't. The ones added by the user won't have it. So to be complete, you have to do two things, check whether there is such an extension and check whether it is set to true.
Extensions are objects. So you have to create them and add them, like in the code above. The syntax is inverse, first you set the property value and second you give it a name. The name is optional because of a different use case, but it is a good practice to always give it a name when using these generic extensions.
Hope this helps. Otherwise ask again
P.S.: I expect to fix the CI for c++11 fully compliant MSVC soon, and be able to merge this in.