anExtrusionFt.selectionList("base").append(
aSketchResult, aSketchFaces[0])
+ anExtrusionFt.string("CreationMethod").setValue("BySizes")
anExtrusionFt.real("from_size").setValue(0)
anExtrusionFt.real("to_size").setValue(10)
+ anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+ anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
# v1.0.2 from master
# anExtrusionFt.selection("extrusion_face").setValue(
# aSketchResult, aSketchFaces[0])
aBox = aPart.addFeature("Extrusion")
aBox.selectionList("base").append(
aSketchResult, aSketchFaces[0])
+aBox.string("CreationMethod").setValue("BySizes")
aBox.real("from_size").setValue(0)
aBox.real("to_size").setValue(10)
+aBox.real("to_offset").setValue(0) #TODO: remove
+aBox.real("from_offset").setValue(0) #TODO: remove
# v 1.0.2 from master
# aBox.selection("extrusion_face").setValue(
# aSketchResult, aSketchFaces[0])
#=========================================================================
# Create a boolean cut of cylinders from the box:
-# result of Boolean is the first argument of the next Boolean
#=========================================================================
aCurrentResult = modelAPI_ResultBody(aBox.firstResult())
aSession.startOperation()
+
+aBooleanFt = aPart.addFeature("Boolean")
+aBooleanFt.selectionList("main_objects").append(aCurrentResult, aCurrentResult.shape())
for i in xrange(0, N * N):
anExtrusionResult = modelAPI_ResultBody(anExtrusions[i].firstResult())
- aBooleanFt = aPart.addFeature("Boolean")
- aBooleanFt.selectionList("main_objects").append(aCurrentResult, aCurrentResult.shape())
aBooleanFt.selectionList("tool_objects").append(anExtrusionResult, anExtrusionResult.shape())
- kBooleanTypeCut = 0
- aBooleanFt.integer("bool_type").setValue(kBooleanTypeCut)
- aBooleanFt.execute()
- aCurrentResult = modelAPI_ResultBody(aBooleanFt.firstResult())
+kBooleanTypeCut = 0
+aBooleanFt.integer("bool_type").setValue(kBooleanTypeCut)
+aBooleanFt.execute()
+aFactory = ModelAPI_Session.get().validators()
+assert (aFactory.validate(aBooleanFt))
+assert (len(aBooleanFt.results()) > 0)
+aCurrentResult = modelAPI_ResultBody(aBooleanFt.firstResult())
+assert (aCurrentResult is not None)
aSession.finishOperation()
#=========================================================================