Code: Select all
class Wall:
def __init__(self,obj):
obj.Proxy = self
obj.addProperty("App::PropertyFloat","LengthofWall")
obj.addProperty("App::PropertyString","NomenclatureofWall")
Code: Select all
class Wall:
def __init__(self,obj):
obj.Proxy = self
obj.addProperty("App::PropertyFloat","LengthofWall")
obj.addProperty("App::PropertyString","NomenclatureofWall")
Code: Select all
def onChanged(self, fp, prop):
print ("onChanged",prop)
if prop=="Size" or prop in ["NomenclatureofWall","n2","e1","e2","e3"]:
set a flag ....
Code: Select all
obj.addProperty("App::PropertyString","NomenclatureofWall","","",8)
Code: Select all
for i, sub in enumerate(obj.Objects):
obj.addProperty('App::PropertyLinkList', "DoorList%d" % i, .....)
obj.addProperty('App::PropertyFloatList', "DoorPosition%d" % i, .....)
One more for my "things I still didn't know in FreeCAD" list
Sorry bringing this up so late again.wmayer wrote: ↑Mon Oct 16, 2017 7:37 am When adding a property you can mark it as output property. This way it won't mark the feature as touched when changing it.Here you can find the different property types: https://github.com/FreeCAD/FreeCAD/blob ... iner.h#L42Code: Select all
obj.addProperty("App::PropertyString","NomenclatureofWall","","",8)
Code: Select all
Prop_Output = 8, /*!< Modified property doesn't touch its parent container */
Prop_NoRecompute = 16,/*!< Modified property doesn't touch its container for recompute */
wmayer wrote: ↑Mon Jun 14, 2021 1:27 pm So, if the goal is that a feature can be marked as touched but shouldn't be recomputed then use: Prop_NoRecompute
If you don't even want that a changed property marks the feature as touched then use: Prop_Output
Hint: The Prop_Output is stronger than Prop_NoRecompute. So, if Prop_Output is set the property won't mark the feature for a recompute either.
Sorry bringing up this again, found issue when use this with Sketcher::SketchObjectPython :wmayer wrote: ↑Mon Oct 16, 2017 7:37 amCode: Select all
obj.addProperty("App::PropertyString","NomenclatureofWall","","",8)
Code: Select all
class ArchSketch:
def __init__(self, fp):
self.setProperties(fp)
def setProperties(self, fp):
prop = fp.PropertiesList
if "MasterSketchSubelementIndex" not in prop:
fp.addProperty("App::PropertyInteger","MasterSketchSubelementIndex","Test","Test", 4+8)
archSketch=App.ActiveDocument.addObject("Sketcher::SketchObjectPython",'ArchSketch_NAME')
Code: Select all
fp.addProperty("App::PropertyInteger","MasterSketchSubelementIndex","Test","Test", 4+8)
change to -
fp.addProperty("App::PropertyInteger","MasterSketchSubelementIndex","Test","Test", 8)