Code: Select all
obj.addProperty("App::PropertyString", "SolverType", "Base", "Type of the solver", 0, True)
Code: Select all
obj.addProperty("App::PropertyString", "SolverType", "Base", "Type of the solver", 1)
Moderator: bernd
Code: Select all
obj.addProperty("App::PropertyString", "SolverType", "Base", "Type of the solver", 0, True)
Code: Select all
obj.addProperty("App::PropertyString", "SolverType", "Base", "Type of the solver", 1)
wmayer wrote:
When loading a project an object's __init__ function won't be called but its __setstate__ function is called instead. So, it should work to call
Code: Select all
self.Object.setEditorMode("MyProperty", 1)
Code: Select all
self.Object = vobj.Object
I played around with this and found that if you want the property hidden, set the last argument to -1 (not 2 like setEditorMode)wmayer wrote:orCode: Select all
obj.addProperty("App::PropertyString", "SolverType", "Base", "Type of the solver", 0, True)
Code: Select all
obj.addProperty("App::PropertyString", "SolverType", "Base", "Type of the solver", 1)
Code: Select all
x1 = 2.0*App.Units.Inch
groupLabel = "Point 1"
toolTip = "X coordinate of point 1"
obj.addProperty("App::PropertyLength", "X1", groupLabel, toolTip, -1).X1 = x1