%feature("director") ModelAPI_Plugin;
%feature("director") ModelAPI_Object;
%feature("director") ModelAPI_Feature;
+%feature("director") ModelAPI_CompositeFeature;
%feature("director") ModelAPI_Data;
// shared pointers
import sketch
-class PythonFeaturesPlugin_Box(ModelAPI.ModelAPI_CompositeFeature):
+class PythonFeaturesPlugin_Box(ModelAPI.ModelAPI_Feature):
"Feature to create a box by drawing a sketch and extruding it"
self.reference(self.HEIGHT_REF_ID()).setValue(aHeightFeature.firstResult())
return aHeightFeature
- def addFeature(self, theID):
- pass
-
- def numberOfSubs(self):
- # extrusion and sketch
- return 2
-
- def subFeature(self, theIndex):
- if theIndex = 1: # sketch
- return self.mySketch
- return self.myExtrusion
-
- def subFeatureId(self, theIndex):
- return 0
-
- def isSub(self, theFeature):
- if theFeature = self.mySketch or theFeature = self.myExtrusion:
- return True
- return False
# TEST
"""
feature = part.addFeature("Extrusion")
feature.selection("extrusion_face").setValue(builder.geometry(),
builder.face())
+ if length < 0.0000001:
+ length = 50
feature.real("extrusion_size").setValue(length)
feature.boolean("extrusion_reverse").setValue(reverse)
feature.execute()