2 Test case for Construction Point feature. Written on High API.
7 from salome.shaper import model
10 aSession = ModelAPI_Session.get()
13 aDocument = aSession.activeDocument()
14 aSession.startOperation()
15 model.addPart(aDocument)
16 aDocument = aSession.activeDocument()
17 aSession.finishOperation()
19 # Create a point by coordinates
20 aSession.startOperation()
21 aPoint = model.addPoint(aDocument, 50, 50, 50)
22 aSession.finishOperation()
23 assert (len(aPoint.results()) > 0)
25 # # Create a sketch with lines
26 # aSession.startOperation()
27 # anOrigin = GeomAPI_Pnt(0, 0, 0)
28 # aDirX = GeomAPI_Dir(1, 0, 0)
29 # aNorm = GeomAPI_Dir(0, 0, 1)
30 # aSketch = model.addSketch(aDocument, GeomAPI_Ax3(anOrigin, aDirX, aNorm))
31 # aSketchLine1 = aSketch.addLine(0, 0, 100, 100)
32 # aSketchLine2 = aSketch.addLine(0, 100, 100, 0)
33 # aSession.finishOperation()
35 # # Create a point on line
36 # aSession.startOperation()
37 # aPoint = model.addPoint(aDocument, aSketchLine1.result()[0], 25, True, False)
38 # aSession.finishOperation()
39 # assert (len(aPoint.result()) > 0)
42 # aSession.startOperation()
43 # aPlane = model.addPlane(aDocument, 1, 1, 1, 1)
44 # aSession.finishOperation()
46 # # Create a point by projection
47 # aSession.startOperation()
48 # aPoint = model.addPoint(aDocument, aPoint.result()[0], aPlane.result()[0])
49 # aSession.finishOperation()
50 # assert (len(aPoint.result()) > 0)
52 # # Create a point by lines intersection
53 # aSession.startOperation()
54 # aPoint = model.addPoint(aDocument, aSketchLine1.result()[0], aSketchLine2.result()[0])
55 # aSession.finishOperation()
56 # assert (len(aPoint.result()) > 0)
58 # # Create a point by line and plane intersection
59 # aSession.startOperation()
60 # aPoint = model.addPoint(aDocument, aSketchLine1.result()[0], aPlane.result()[0])
61 # aSession.finishOperation()
62 # assert (len(aPoint.result()) > 0)
64 assert(model.checkPythonDump())