Salome HOME
Fix errors and adjust unit tests
[modules/shaper.git] / src / SketchPlugin / Test / TestProjection.py
index 0b89eca5fee9378ebc98f2f7ec090f95d5beaa4e..ee3151c430e805a7d029d7df1a85c1e3fcba54d6 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()
 #=========================================================================