3 class PythonFeaturesPlugin_Box(ModelAPI.ModelAPI_Feature):
4 "Feature to create a box by drawing a sketch and extruding it"
6 ModelAPI.ModelAPI_Feature.__init__(self)
25 return PythonFeaturesPlugin_Box.ID()
27 def initAttributes(self):
28 # C++ static methods (in example Type() of ModelAPI_AttributeDouble
29 # should be called like this: moduleName.ClassName_StaticMethod()
30 self.data().addAttribute(PythonFeaturesPlugin_Box.WIDTH_ID(), ModelAPI.ModelAPI_AttributeDouble_type())
31 self.data().addAttribute(PythonFeaturesPlugin_Box.LENGTH_ID(), ModelAPI.ModelAPI_AttributeDouble_type())
32 self.data().addAttribute(PythonFeaturesPlugin_Box.HEIGHT_ID(), ModelAPI.ModelAPI_AttributeDouble_type())
35 aWidth = self.real(PythonFeaturesPlugin_Box.WIDTH_ID()).value()
36 aLength = self.real(PythonFeaturesPlugin_Box.LENGTH_ID()).value()
37 aHeight = self.real(PythonFeaturesPlugin_Box.HEIGHT_ID()).value()
38 print ("Box W:{0} L:{1} H:{2}".format(aWidth, aLength, aHeight))
39 # aResult = document().createBody(data())
40 # aResult.store(UserPackage.makeBox(aLength, aWidth, aHeight)
41 # self.setResult(aResult)