Code: Select all
b=App.ActiveDocument.addObject("Part::Box","Box")
b.addProperty("App::PropertyStringList","script","main","script")
When I use FeaturePython, then I can add my property but have to reimplement all the Box functionality.
Code: Select all
b1=App.ActiveDocument.addObject("Part::FeaturePython","My")
b1.addProperty("App::PropertyStringList","script","main","script")
Code: Select all
class MyBox(PartBox):
def __init__(self,**args):
super(PartBox, self).__init__(**args)
self.script=["Hello", "it's so simple to add a property"]
Code: Select all
b2=App.ActiveDocument.addObject("Part::Box::MyBox","MyBox")
b2.addProperty("App::PropertyStringList","script","main","script")
b2.script=["Hello", "it's so simple to add a property"]