#=========================================================================
aSession.startOperation()
aPlaneFeature = aPart.addFeature("Plane")
-aPlaneFeature.string("CreationMethod").setValue("PlaneByGeneralEquation")
+aPlaneFeature.string("creation_method").setValue("by_general_equation")
+aPlaneFeature.string("by_other_plane_option").setValue("by_distance_from_other") # TODO: remove
aPlaneFeature.real("A").setValue(0.)
aPlaneFeature.real("B").setValue(1.)
aPlaneFeature.real("C").setValue(0.)
aSession.startOperation()
aPartitionFt = aPart.addFeature("Partition")
assert (aPartitionFt.getKind() == "Partition")
-aPartitionFt.selectionList("main_objects").append(anExtrusionResult, anExtrusionResult.shape())
-aPartitionFt.selectionList("tool_objects").append(aPlaneResult, None)
-aPartitionFt.boolean("partition_combine").setValue(True)
+aPartitionFt.selectionList("base_objects").append(anExtrusionResult, anExtrusionResult.shape())
+aPartitionFt.selectionList("base_objects").append(aPlaneResult, None)
aPartitionFt.execute()
aSession.finishOperation()
assert (len(aPartitionFt.results()) > 0)
aPartitionResult = modelAPI_ResultBody(aPartitionFt.firstResult())
assert (aPartitionResult is not None)
+aSession.undo()
+
+#=========================================================================
+# Create a partition
+#=========================================================================
+aSession.startOperation()
+aPartitionFt = aPart.addFeature("Partition")
+assert (aPartitionFt.getKind() == "Partition")
+aPartitionFt.selectionList("base_objects").append(anExtrusionResult, anExtrusionResult.shape())
+aPartitionFt.selectionList("base_objects").append(aPlaneResult, None)
+aPartitionFt.execute()
+aSession.finishOperation()
+
+#=========================================================================
+# Test results
+#=========================================================================
+aFactory = ModelAPI_Session.get().validators()
+assert (aFactory.validate(aPartitionFt))
+assert (len(aPartitionFt.results()) > 0)
+aPartitionResult = modelAPI_ResultBody(aPartitionFt.firstResult())
+assert (aPartitionResult is not None)
+
+import model
+assert(model.checkPythonDump())