]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1773: Script python does not work
authordbv <dbv@opencascade.com>
Tue, 15 Nov 2016 13:40:54 +0000 (16:40 +0300)
committerdbv <dbv@opencascade.com>
Tue, 15 Nov 2016 13:41:12 +0000 (16:41 +0300)
- Renamed the current method "result" by "results";
- Added the function "result" returning the first result, that is "results()[0]";
- Python Dump generate a call to "result()" instead of producing a call to "results()[0]".

18 files changed:
src/BuildPlugin/Test/TestWire.py
src/ConstructionPlugin/Test/TestAxisCreation.py
src/ConstructionPlugin/Test/TestPlane.py
src/ConstructionPlugin/Test/TestPoint.py
src/ExchangePlugin/Test/TestExport.py
src/FeaturesPlugin/Test/TestBoolean.py
src/FeaturesPlugin/Test/TestBooleanFill.py
src/FeaturesPlugin/Test/TestRecover.py
src/ModelAPI/Test/Test1757.py
src/ModelHighAPI/ModelHighAPI_Dumper.cpp
src/ModelHighAPI/ModelHighAPI_Interface.cpp
src/ModelHighAPI/ModelHighAPI_Interface.h
src/ModelHighAPI/Test/TestDeflectionDump.py
src/PythonAPI/Test/TestPrimitivesBox.py
src/PythonAPI/examples/MakeBrick1.py
src/PythonAPI/examples/MakeBrick2.py
src/PythonAPI/examples/Platine.py
src/SketchPlugin/Test/TestSplit.py

index 0d3bb161838997128ede3b15399ba8ff75f01ed5..8598eac579535946268abed82951e5396783a7a0 100644 (file)
@@ -78,10 +78,10 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(),
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
-SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result()[0])
-SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()[0])
-SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result()[0])
-SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()[0])
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
 Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")])
 Wire_1.addContour()
index 2c0dabfb65c2020abaa63e20e917e834840be4e8..61b3dfd7f2280e8e222de598a12ab169ce2e17ec 100644 (file)
@@ -148,9 +148,9 @@ aSession.finishOperation()
 
 # Test an axis by line
 aSession.startOperation()
-anAxis = model.addAxis(aPart, aSketchLine.result()[0])
+anAxis = model.addAxis(aPart, aSketchLine.result())
 aSession.finishOperation()
-assert (len(anAxis.result()) > 0)
+assert (len(anAxis.results()) > 0)
 
 # Create plane
 aSession.startOperation()
@@ -168,9 +168,9 @@ aSession.finishOperation()
 
 # Test an axis by plane and point
 aSession.startOperation()
-anAxis = model.addAxis(aPart, aPlane1.result()[0], aSketchPoint.result()[0])
+anAxis = model.addAxis(aPart, aPlane1.result(), aSketchPoint.result())
 aSession.finishOperation()
-assert (len(anAxis.result()) > 0)
+assert (len(anAxis.results()) > 0)
 
 # Create plane
 aSession.startOperation()
@@ -179,15 +179,15 @@ aSession.finishOperation()
 
 # Test an axis by two planes
 aSession.startOperation()
-anAxis = model.addAxis(aPart, aPlane1.result()[0], aPlane2.result()[0])
+anAxis = model.addAxis(aPart, aPlane1.result(), aPlane2.result())
 aSession.finishOperation()
-assert (len(anAxis.result()) > 0)
+assert (len(anAxis.results()) > 0)
 
 # Test an axis by two planes and offsets
 aSession.startOperation()
-anAxis = model.addAxis(aPart, aPlane1.result()[0], 50, False, aPlane2.result()[0], 100, True)
+anAxis = model.addAxis(aPart, aPlane1.result(), 50, False, aPlane2.result(), 100, True)
 aSession.finishOperation()
-assert (len(anAxis.result()) > 0)
+assert (len(anAxis.results()) > 0)
 
 import model
 assert(model.checkPythonDump())
index 3a3b7c862d2fc2149fb0bdfb70c9a062bf835427..6669c2d1b3cdc60041db827c7d5a46ab457dcea7 100644 (file)
@@ -20,7 +20,7 @@ aSession.finishOperation()
 aSession.startOperation()
 aPlane = model.addPlane(aDocument, 1, 1, 1, 0)
 aSession.finishOperation()
-assert (len(aPlane.result()) > 0)
+assert (len(aPlane.results()) > 0)
 
 # Create a point 1
 aSession.startOperation()
@@ -39,9 +39,9 @@ aSession.finishOperation()
 
 # Test a plane by three points
 aSession.startOperation()
-aPlane = model.addPlane(aDocument, aPoint1.result()[0], aPoint2.result()[0], aPoint3.result()[0])
+aPlane = model.addPlane(aDocument, aPoint1.result(), aPoint2.result(), aPoint3.result())
 aSession.finishOperation()
-assert (len(aPlane.result()) > 0)
+assert (len(aPlane.results()) > 0)
 
 # Create an axis
 aSession.startOperation()
@@ -50,21 +50,21 @@ aSession.finishOperation()
 
 # Test a plane by line and point
 aSession.startOperation()
-aPlane = model.addPlane(aDocument, anAxis.result()[0], aPoint3.result()[0], True)
+aPlane = model.addPlane(aDocument, anAxis.result(), aPoint3.result(), True)
 aSession.finishOperation()
-assert (len(aPlane.result()) > 0)
+assert (len(aPlane.results()) > 0)
 
 # Test a plane by distance from other
 aSession.startOperation()
-aPlane = model.addPlane(aDocument, aPlane.result()[0], 50, False)
+aPlane = model.addPlane(aDocument, aPlane.result(), 50, False)
 aSession.finishOperation()
-assert (len(aPlane.result()) > 0)
+assert (len(aPlane.results()) > 0)
 
 # Test a plane by coincidence to point
 aSession.startOperation()
-aCoincidentPlane = model.addPlane(aDocument, aPlane.result()[0], aPoint2.result()[0])
+aCoincidentPlane = model.addPlane(aDocument, aPlane.result(), aPoint2.result())
 aSession.finishOperation()
-assert (len(aCoincidentPlane.result()) > 0)
+assert (len(aCoincidentPlane.results()) > 0)
 
 # Create an axis
 aSession.startOperation()
@@ -73,15 +73,15 @@ aSession.finishOperation()
 
 # Test a plane by rotation
 aSession.startOperation()
-aRotatedPlane = model.addPlane(aDocument, aCoincidentPlane.result()[0], anAxis.result()[0], 45)
+aRotatedPlane = model.addPlane(aDocument, aCoincidentPlane.result(), anAxis.result(), 45)
 aSession.finishOperation()
-assert (len(aRotatedPlane.result()) > 0)
+assert (len(aRotatedPlane.results()) > 0)
 
 # Test plane by two parallel planes
 aSession.startOperation()
-aPlane = model.addPlane(aDocument, aCoincidentPlane.result()[0], aPlane.result()[0])
+aPlane = model.addPlane(aDocument, aCoincidentPlane.result(), aPlane.result())
 aSession.finishOperation()
-assert (len(aPlane.result()) > 0)
+assert (len(aPlane.results()) > 0)
 
 import model
 assert(model.checkPythonDump())
index d91d746345f18923b8fb934fcffdfa7ec5b822d1..2614281bc439e91f9cb105d18b8e506cfc837fd8 100644 (file)
@@ -20,7 +20,7 @@ aSession.finishOperation()
 aSession.startOperation()
 aPoint = model.addPoint(aDocument, 50, 50, 50)
 aSession.finishOperation()
-assert (len(aPoint.result()) > 0)
+assert (len(aPoint.results()) > 0)
 
 # # Create a sketch with lines
 # aSession.startOperation()
index eda5c0aff3e2a9c0f647177d637695757e61dfec..f3afbf36f6bb5acce08eb1a8c693990dc9a474d7 100644 (file)
@@ -46,7 +46,7 @@ def testExport(theType, theFormat, theFile, theVolume, theDelta):
     removeFile(theFile)
     # Export a part
     aSession.startOperation("Export part")
-    model.exportToFile(aPart, theFile, anImport.result(), theFormat)
+    model.exportToFile(aPart, theFile, anImport.results(), theFormat)
 #     anExportFeature = aPart.addFeature("Export")
 #     anExportFeature.string("file_format").setValue(theFormat)
 #     anExportFeature.string("file_path").setValue(theFile)
@@ -77,7 +77,7 @@ def testExportXAO():
 
     # Create groups
     aSession.startOperation()
-    aGroup = model.addGroup(aPart, anImport.result())
+    aGroup = model.addGroup(aPart, anImport.results())
     aGroup.defaultResult().data().setName("boite_1")
     aGroup.groupList().setSelectionType("solid")
 #     aGroupFeature = aSession.activeDocument().addFeature("Group")
index 12d51b7237b6746e26bbf0a9ebe57f8a803cd54e..8c6b67fd20b949003cb1a1a84e8aa8dad790bc60 100644 (file)
@@ -134,7 +134,7 @@ model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), 10, 0)
 Boolean_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")])
 model.end()
-assert(len(Boolean_1.result()) > 0)
+assert(len(Boolean_1.results()) > 0)
 
 model.begin()
 partSet = model.moduleDocument()
@@ -149,6 +149,6 @@ model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), 10, 0)
 Boolean_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")])
 model.end()
-assert(len(Boolean_1.result()) > 0)
+assert(len(Boolean_1.results()) > 0)
 
 assert(model.checkPythonDump())
index 524286a3511b6501124cf5dc40cccb6c73dc3f8e..6a29649ca0efcf0b9ec8fec4fc09d4b01b2ebfaf 100644 (file)
@@ -35,13 +35,13 @@ aSession.finishOperation()
 
 # Make extrusion on circle (cylinder) and triangle (prism)
 aSession.startOperation()
-anExtrusion = model.addExtrusion(aDocument, aCircleSketch.result() + aTriangleSketch.result(), 100)
+anExtrusion = model.addExtrusion(aDocument, aCircleSketch.results() + aTriangleSketch.results(), 100)
 aSession.finishOperation()
 
 # Fill prism with cylinder
 aSession.startOperation()
-aBoolean = model.addFill(aDocument, [anExtrusion.result()[0]], [anExtrusion.result()[1]])
-assert (len(aBoolean.result()) > 0)
+aBoolean = model.addFill(aDocument, [anExtrusion.results()[0]], [anExtrusion.results()[1]])
+assert (len(aBoolean.results()) > 0)
 aSession.finishOperation()
 
 assert(model.checkPythonDump())
index f3afa4106e83ef0b8fed2eb3062303f4dd459808..1a2765bc9d3b50a406dcf8002c20f90e308dea76 100644 (file)
@@ -23,14 +23,14 @@ c2 = sk2.addCircle(20, 30, 30)
 model.do()
 smallcyl = model.addExtrusion(mypart, sk2.selectFace(), 150)
 
-cut = model.addCut(mypart, bigcyl.result(), smallcyl.result())
+cut = model.addCut(mypart, bigcyl.results(), smallcyl.results())
 
 model.do()
 
 # check bodies number is 1: only Boolean result
 assert(mypart.size("Bodies") == 1)
 
-model.addRecover(mypart, cut, smallcyl.result())
+model.addRecover(mypart, cut, smallcyl.results())
 
 model.end()
 
@@ -46,14 +46,14 @@ assert(mypart.size("Bodies") == 1)
 # check persistent flag of recover: never concealed
 model.begin()
 
-recover = model.addRecover(mypart, cut, smallcyl.result(), True)
+recover = model.addRecover(mypart, cut, smallcyl.results(), True)
 assert(mypart.size("Bodies") == 2)
 sk3 = model.addSketch(mypart, model.defaultPlane("XOY"))
 c3 = sk3.addCircle(0, 0, 90)
 model.do()
 big2 = model.addExtrusion(mypart, sk3.selectFace(), 110)
 
-cut2 = model.addCut(mypart, big2.result(), smallcyl.result())
+cut2 = model.addCut(mypart, big2.results(), smallcyl.results())
 
 model.end()
 
index 236eac9b48d6e0f7727cc4dd188feda04bef38da..ccd4b625e801f0a97d9757249a00f4b860aec017 100644 (file)
@@ -29,10 +29,10 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(),
 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
-SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result()[0])
-SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result()[0])
-SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result()[0])
-SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result()[0])
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
 model.do()
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 300, 0)
 
@@ -49,10 +49,10 @@ SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_8.endPoint(),
 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
-SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_5.result()[0])
-SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result()[0])
-SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result()[0])
-SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result()[0])
+SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
+SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
 ExtrusionCut_1.setNestedSketch(Sketch_2)
 model.do()
 
@@ -82,10 +82,10 @@ SketchConstraintCoincidence_9 = Sketch_4.setCoincident(SketchLine_12.endPoint(),
 SketchConstraintCoincidence_10 = Sketch_4.setCoincident(SketchLine_9.endPoint(), SketchLine_10.startPoint())
 SketchConstraintCoincidence_11 = Sketch_4.setCoincident(SketchLine_10.endPoint(), SketchLine_11.startPoint())
 SketchConstraintCoincidence_12 = Sketch_4.setCoincident(SketchLine_11.endPoint(), SketchLine_12.startPoint())
-SketchConstraintHorizontal_5 = Sketch_4.setHorizontal(SketchLine_9.result()[0])
-SketchConstraintVertical_5 = Sketch_4.setVertical(SketchLine_10.result()[0])
-SketchConstraintHorizontal_6 = Sketch_4.setHorizontal(SketchLine_11.result()[0])
-SketchConstraintVertical_6 = Sketch_4.setVertical(SketchLine_12.result()[0])
+SketchConstraintHorizontal_5 = Sketch_4.setHorizontal(SketchLine_9.result())
+SketchConstraintVertical_5 = Sketch_4.setVertical(SketchLine_10.result())
+SketchConstraintHorizontal_6 = Sketch_4.setHorizontal(SketchLine_11.result())
+SketchConstraintVertical_6 = Sketch_4.setVertical(SketchLine_12.result())
 model.do()
 ExtrusionCut_3.setNestedSketch(Sketch_4)
 
index 2764c17982a162a8a6e7817010128dd8be516513..09338cc1c089a2e8a4a18a205ef190eed489226b 100644 (file)
@@ -652,7 +652,13 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const ResultPtr& theResult)
       break;
     }
   }
-  myDumpBuffer << name(aFeature) << ".result()[" << anIndex << "]";
+
+  myDumpBuffer << name(aFeature);
+  if(anIndex == 0) {
+    myDumpBuffer << ".result()";
+  } else {
+    myDumpBuffer << ".results()[" << anIndex << "]";
+  }
   return *this;
 }
 
index 51d6f036aabf86035dfb71d9140153283efd7f22..73c14aefc6a7d9c91678a7814b4013605ebc643f 100644 (file)
@@ -79,7 +79,14 @@ void ModelHighAPI_Interface::setName(const std::string& theName)
   feature()->data()->setName(theName);
 }
 
-std::list<ModelHighAPI_Selection> ModelHighAPI_Interface::result() const
+ModelHighAPI_Selection ModelHighAPI_Interface::result() const
+{
+  const_cast<ModelHighAPI_Interface*>(this)->execute();
+
+  return ModelHighAPI_Selection(feature()->firstResult());
+}
+
+std::list<ModelHighAPI_Selection> ModelHighAPI_Interface::results() const
 {
   const_cast<ModelHighAPI_Interface*>(this)->execute();
 
index 669559d9ad9c411464ae498524de779b68791bea..7c9774e3aa540cbde44096bb82aa02013e24f41d 100644 (file)
@@ -58,9 +58,13 @@ public:
   MODELHIGHAPI_EXPORT
   void setName(const std::string& theName);
 
+  /// Return firts object of the feature
+  MODELHIGHAPI_EXPORT
+  virtual ModelHighAPI_Selection result() const;
+
   /// Return all objects of the feature
   MODELHIGHAPI_EXPORT
-  virtual std::list<ModelHighAPI_Selection> result() const;
+  virtual std::list<ModelHighAPI_Selection> results() const;
 
   /// Return default result. Default implementation feature()->lastResult()
   MODELHIGHAPI_EXPORT
index 49b0c87baa5ef611735c5e3f75faeb3556e4707b..668f7c9e17fde59650f63bc4d2d139561871af83 100644 (file)
@@ -7,9 +7,9 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_1 = Sketch_1.addCircle(-325.90051457976, -18.010291595197, 258.003584159371)
 model.do()
-Sketch_1.result()[0].setDeflection(5e-006)
+Sketch_1.result().setDeflection(5e-006)
 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 10, 0)
-Extrusion_1.result()[0].setDeflection(0.5)
+Extrusion_1.result().setDeflection(0.5)
 model.end()
 
 assert(model.checkPythonDump())
index e78b131e41643d75815ae49237a4c44ba4707633..692a1c5027b217ead607a8113df023f79aa1c004 100644 (file)
@@ -33,7 +33,7 @@ class PrimitivesAddBoxTestCase(PrimitivesAddBox):
     def test_add_box_by_two_points(self):
         point1 = model.addPoint(self.part,0,0,0).result()
         point2 = model.addPoint(self.part,10,10,10).result()
-        box = model.addBox(self.part, point1[0], point2[0])
+        box = model.addBox(self.part, point1, point2)
         model.do()
         self.assertEqual(box.creationMethod().value(),"BoxByTwoPoints")
         self.assertEqual(box.firstPoint().context().shape().isVertex(),True)
index 5ef2f3c459fe26a2f0071d94dbfa91a04b4ec834..6434488d4fb26325add62aa0eee421f4e396211a 100644 (file)
@@ -69,7 +69,7 @@ model.do()
 
 # Subtracting the cylinder to the box
 
-model.addCut(mypart, mybox.result(), myboss.result())
+model.addCut(mypart, mybox.results(), myboss.results())
 model.end()
 
 
index 1be7e05fde0aad6cf8db3afeb863997ede6693a9..843773eebd0406e6a8c7b5dfea64fee6b1274e91 100644 (file)
@@ -62,7 +62,7 @@ model.do()
 
 # Subtracting the cylinder to the box
 
-model.addCut(mypart, mybox.result(), myboss.result())
+model.addCut(mypart, mybox.results(), myboss.results())
 model.end()
 
 
index a21d55eed5d1e1bbf39f8d875c8289460c40745d..c4c9254e1f5d30ff0cf6e4d5b1f3b177a380acda 100644 (file)
@@ -190,12 +190,12 @@ def body_4():
 b1 = vertical_body()
 b2 = bottom_body()
 
-boolean = model.addFuse(part, b1.result() + b2.result())
+boolean = model.addFuse(part, b1.results() + b2.results())
 model.do()
 
 b3 = body_3()
 
-boolean = model.addFuse(part, boolean.result() + b3.result())
+boolean = model.addFuse(part, boolean.results() + b3.results())
 model.do()
 
 # START DEBUG PURPOSES
@@ -209,7 +209,7 @@ model.do()
 # END DEBUG PURPOSES
 b4 = body_4()
 
-boolean = model.addFuse(part, boolean.result() + b4.result())
+boolean = model.addFuse(part, boolean.results() + b4.results())
 model.end()
 
 assert(model.checkPythonDump())
index 36a03f97f11b075f014f037f45936afbb1d22e5e..d078e956acbfe6089c38b65eacb56dccefc626f4 100644 (file)
@@ -18,7 +18,7 @@ Part_1_doc = Part_1.document()
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_1 = Sketch_1.addLine(0, 50, 100, 50)
 SketchPoint_1 = Sketch_1.addPoint(50, 50)
-SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_1.result()[0])
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchLine_1.result())
 Sketch_1.addSplit(SketchLine_1, SketchPoint_1.coordinates(), SketchLine_1.endPoint())
 model.do()
 
@@ -38,8 +38,8 @@ Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchLine_2_1 = Sketch_2.addLine(0, 50, 100, 50)
 SketchPoint_2_1 = Sketch_2.addPoint(25, 50)
 SketchPoint_2_2 = Sketch_2.addPoint(75, 50)
-SketchConstraintCoincidence_2_1 = Sketch_2.setCoincident(SketchPoint_2_1.coordinates(), SketchLine_2_1.result()[0])
-SketchConstraintCoincidence_2_2 = Sketch_2.setCoincident(SketchPoint_2_2.coordinates(), SketchLine_2_1.result()[0])
+SketchConstraintCoincidence_2_1 = Sketch_2.setCoincident(SketchPoint_2_1.coordinates(), SketchLine_2_1.result())
+SketchConstraintCoincidence_2_2 = Sketch_2.setCoincident(SketchPoint_2_2.coordinates(), SketchLine_2_1.result())
 Sketch_2.addSplit(SketchLine_2_1, SketchPoint_2_1.coordinates(), SketchPoint_2_2.coordinates())
 model.do()
 
@@ -59,8 +59,8 @@ Sketch_3 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
 SketchCircle_3_1 = Sketch_3.addCircle(50, 50, 50)
 SketchPoint_3_1 = Sketch_3.addPoint(50, 0)
 SketchPoint_3_2 = Sketch_3.addPoint(50, 100)
-SketchConstraintCoincidence_3_1 = Sketch_3.setCoincident(SketchPoint_3_1.coordinates(), SketchCircle_3_1.result()[1])
-SketchConstraintCoincidence_3_2 = Sketch_3.setCoincident(SketchPoint_3_2.coordinates(), SketchCircle_3_1.result()[1])
+SketchConstraintCoincidence_3_1 = Sketch_3.setCoincident(SketchPoint_3_1.coordinates(), SketchCircle_3_1.results()[1])
+SketchConstraintCoincidence_3_2 = Sketch_3.setCoincident(SketchPoint_3_2.coordinates(), SketchCircle_3_1.results()[1])
 Sketch_3.addSplit(SketchCircle_3_1, SketchPoint_3_1.coordinates(), SketchPoint_3_2.coordinates())
 model.do()
 
@@ -82,7 +82,7 @@ Sketch_4.setFixed(SketchArc_4_1.startPoint())
 Sketch_4.setFixed(SketchArc_4_1.endPoint())
 Sketch_4.setRadius(SketchArc_4_1, 50)
 SketchPoint_4_1 = Sketch_4.addPoint(50, 100)
-SketchConstraintCoincidence_4_1 = Sketch_4.setCoincident(SketchPoint_4_1.coordinates(), SketchArc_4_1.result()[1])
+SketchConstraintCoincidence_4_1 = Sketch_4.setCoincident(SketchPoint_4_1.coordinates(), SketchArc_4_1.results()[1])
 Sketch_4.addSplit(SketchArc_4_1, SketchPoint_4_1.coordinates(), SketchArc_4_1.endPoint())
 model.do()
 
@@ -105,10 +105,10 @@ Sketch_5.setFixed(SketchArc_5_1.startPoint())
 Sketch_5.setFixed(SketchArc_5_1.endPoint())
 Sketch_5.setRadius(SketchArc_5_1, 50)
 SketchLine_5_1 = Sketch_5.addLine(25, 93.301270189222, 75, 93.301270189222)
-SketchConstraintCoincidence_5_1 = Sketch_5.setCoincident(SketchLine_5_1.startPoint(), SketchArc_5_1.result()[1])
-SketchConstraintCoincidence_5_2 = Sketch_5.setCoincident(SketchLine_5_1.endPoint(), SketchArc_5_1.result()[1])
-SketchConstraintHorizontal_5_1 = Sketch_5.setHorizontal(SketchLine_5_1.result()[0])
-SketchConstraintLength_5_1 = Sketch_5.setLength(SketchLine_5_1.result()[0], 50)
+SketchConstraintCoincidence_5_1 = Sketch_5.setCoincident(SketchLine_5_1.startPoint(), SketchArc_5_1.results()[1])
+SketchConstraintCoincidence_5_2 = Sketch_5.setCoincident(SketchLine_5_1.endPoint(), SketchArc_5_1.results()[1])
+SketchConstraintHorizontal_5_1 = Sketch_5.setHorizontal(SketchLine_5_1.result())
+SketchConstraintLength_5_1 = Sketch_5.setLength(SketchLine_5_1.result(), 50)
 Sketch_5.addSplit(SketchArc_5_1, SketchLine_5_1.startPoint(), SketchLine_5_1.endPoint())
 model.do()