1 def parameter_create(name, expression):
2 clickButton(waitForObject(":Parameters.Parameter_AppElements_Button"))
3 type(waitForObject(":Parameter_QLineEdit"), name)
4 type(waitForObject(":Parameter_ExpressionEditor"), expression)
5 clickButton(waitForObject(":Parameter.property_panel_ok_QToolButton"))
8 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Part")
9 clickButton(waitForObject(":Operations.New part_AppElements_Button"))
11 def sketch_create(point, actions):
12 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Sketch")
13 clickButton(waitForObject(":Basic.Sketch_AppElements_Button"))
14 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
18 clickButton(waitForObject(":Sketch.Ok_QToolButton"))
20 def point_create(point):
21 clickButton(waitForObject(":Basic.Point_AppElements_Button"))
23 type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
24 type(waitForObject(":Point.X:_ModuleBase_ParamSpinBox"), point[0])
25 type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
26 type(waitForObject(":Point.Y:_ModuleBase_ParamSpinBox"), point[1])
28 clickButton(waitForObject(":Point.property_panel_ok_QToolButton"))
30 def line_create(start_point, end_point):
31 clickButton(waitForObject(":Basic.Line_AppElements_Button"))
33 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
34 type(waitForObject(":Start point.X:_ModuleBase_ParamSpinBox"), start_point[0])
35 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
36 type(waitForObject(":Start point.Y:_ModuleBase_ParamSpinBox"), start_point[1])
38 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
39 type(waitForObject(":End point.X:_ModuleBase_ParamSpinBox"), end_point[0])
40 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
41 type(waitForObject(":End point.Y:_ModuleBase_ParamSpinBox"), end_point[1])
43 clickButton(waitForObject(":Line.property_panel_ok_QToolButton"))
45 def circle_create(x, y, radius):
46 clickButton(waitForObject(":Basic.Circle_AppElements_Button"))
48 type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
49 type(waitForObject(":Center.X:_ModuleBase_ParamSpinBox"), x)
50 type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
51 type(waitForObject(":Center.Y:_ModuleBase_ParamSpinBox"), y)
53 type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
54 type(waitForObject(":Circle.CircleRadius_ModuleBase_ParamSpinBox"), radius)
56 clickButton(waitForObject(":Circle.property_panel_ok_QToolButton"))
58 def distance_create(point_1, point_2, annotaion_point, distance):
59 clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
61 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_1[0], point_1[1], 0, Qt.LeftButton)
62 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point_2[0], point_2[1], 0, Qt.LeftButton)
63 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), annotaion_point[0], annotaion_point[1], 0, Qt.LeftButton) # move annotation
65 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
66 type(waitForObject(":_ModuleBase_ParamSpinBox"), distance)
67 type(waitForObject(":_ModuleBase_ParamSpinBox"), "<Return>")
69 clickButton(waitForObject(":Constraints.Distance_AppElements_Button"))
71 def extrusion_feature(points, to_size):
72 clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features")
73 clickButton(waitForObject(":Extrusion.Extrusion_AppElements_Button"))
75 mouseClick(waitForObject(":Extrusion.Select a sketch face_QListWidget"), 10, 10, 0, Qt.LeftButton)
77 mouseClick(waitForObject(":OpenParts*_AppElements_ViewPort"), point[0], point[1], 0, Qt.LeftButton)
79 type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), "<Ctrl+A>")
80 type(waitForObject(":to_size_ModuleBase_ParamSpinBox"), to_size)
82 clickButton(waitForObject(":Extrusion.property_panel_ok_QToolButton"))