2 from model.roots import Interface
5 class CompositeBoolean(Interface):
6 """Interface class for CompositeBoolean features.
8 CompositeBoolean(feature) -> feature interface without initialization
9 CompositeBoolean(feature, sketch, sketch_selection, boolean_objects) ->
10 feature interface initialized from arguments:
16 def __init__(self, feature, *args):
17 """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
18 Interface.__init__(self, feature)
20 self._sketch = self._feature.reference("sketch")
21 self._sketch_selection = self._feature.selection("sketch_selection")
22 self._boolean_objects = self._feature.selectionList("boolean_objects")
25 assert(self._sketch_selection)
26 assert(self._boolean_objects)
31 assert(len(args) == 3)
32 sketch, sketch_selection, boolean_objects = args
34 self.setSketch(sketch)
35 self.setSketchSelection(sketch_selection)
36 self.setBooleanObjects(boolean_objects)
39 def setSketch(self, sketch):
40 """Modify sketch attribute"""
41 self._fillAttribute(self._sketch, sketch)
44 def setSketchSelection(self, sketch_selection):
45 """Modify sketch_selection attribute"""
46 self._fillAttribute(self._sketch_selection, sketch_selection)
49 def setBooleanObjects(self, boolean_objects):
50 """Modify boolean_objects attribute"""
51 self._fillAttribute(self._boolean_objects, boolean_objects)
55 class CompositeSketch(Interface):
56 """Interface class for CompositeSketch features.
58 CompositeSketch(feature) -> feature interface without initialization
59 CompositeSketch(feature, sketch, sketch_selection) ->
60 feature interface initialized from arguments:
66 def __init__(self, feature, *args):
67 """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
68 Interface.__init__(self, feature)
70 self._sketch = self._feature.reference("sketch")
71 self._sketch_selection = self._feature.selection("sketch_selection")
74 assert(self._sketch_selection)
79 assert(len(args) == 2)
80 sketch, sketch_selection = args
82 self.setSketch(sketch)
83 self.setSketchSelection(sketch_selection)
86 def setSketch(self, sketch):
87 """Modify sketch attribute"""
88 self._fillAttribute(self._sketch, sketch)
91 def setSketchSelection(self, sketch_selection):
92 """Modify sketch_selection attribute"""
93 self._fillAttribute(self._sketch_selection, sketch_selection)