Salome HOME
SketchSolver Refactoring: Eliminate SolveSpace as a sketch solver.
[modules/shaper.git] / src / SketchPlugin / Test / TestProjection.py
index 909d079be762ff59f888b5b4f922e97b817c47a1..eddc1e7448798b1155926ea8b6ead15c67b22f1b 100644 (file)
@@ -70,28 +70,16 @@ aSession.finishOperation()
 # Project all features onto the new sketch
 #=========================================================================
 aSession.startOperation()
-anExtLineRes = modelAPI_Result(aDocument.objectByName("Construction", "SketchLine_1"))
-assert(anExtLineRes)
-anExtLineShape = anExtLineRes.shape()
-assert(anExtLineShape)
 aLineProjector = aSketchFeature.addFeature("SketchProjection")
-aLineProjector.selection("ExternalFeature").setValue(anExtLineRes, anExtLineShape)
+aLineProjector.selection("ExternalFeature").selectSubShape("EDGE", "Sketch_1/Edge-SketchLine_1")
 aLineProjector.execute()
 
-anExtCircRes = modelAPI_Result(aDocument.objectByName("Construction", "SketchCircle_1_2"))
-assert(anExtCircRes)
-anExtCircShape = anExtCircRes.shape()
-assert(anExtCircShape)
 aCircleProjector = aSketchFeature.addFeature("SketchProjection")
-aCircleProjector.selection("ExternalFeature").setValue(anExtCircRes, anExtCircShape)
+aCircleProjector.selection("ExternalFeature").selectSubShape("EDGE", "Sketch_1/Edge-SketchCircle_1_2")
 aCircleProjector.execute()
 
-anExtArcRes = modelAPI_Result(aDocument.objectByName("Construction", "SketchArc_1_2"))
-assert(anExtArcRes)
-anExtArcShape = anExtArcRes.shape()
-assert(anExtArcShape)
 anArcProjector = aSketchFeature.addFeature("SketchProjection")
-anArcProjector.selection("ExternalFeature").setValue(anExtArcRes, anExtArcShape)
+anArcProjector.selection("ExternalFeature").selectSubShape("EDGE", "Sketch_1/Edge-SketchArc_1_2")
 anArcProjector.execute()
 aSession.finishOperation()
 #=========================================================================
@@ -137,3 +125,6 @@ assert(math.fabs(aProjLineEnd.y() - aLineEnd.y()) < 1.e-10)
 #=========================================================================
 # End of test
 #=========================================================================
+
+#from salome.shaper import model
+#assert(model.checkPythonDump())