Advertisement
Mark2020H

Python Script for freecad to model chess peice

Jan 2nd, 2021
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 57.75 KB | None | 0 0
  1. ''' Python Script for freecad to model chess peice  MD Harrington https://www.facebook.com/mark.harrington.142892 '''
  2.  
  3. Python 3.6.12 (default, Dec 02 2020, 09:44:23) [GCC] on linux Type
  4. 'help', 'copyright', 'credits' or 'license' for more information.
  5. exec(open('/usr/share/FreeCAD/Mod/Start/StartPage/LoadNew.py').read())
  6. App.setActiveDocument("Unnamed")
  7. App.ActiveDocument=App.getDocument("Unnamed")
  8. Gui.ActiveDocument=Gui.getDocument("Unnamed")
  9. Gui.activateWorkbench("PartDesignWorkbench")
  10. App.activeDocument().addObject('PartDesign::Body','Body') import
  11. PartDesignGui Gui.activeView().setActiveObject('pdbody',
  12. App.activeDocument().Body) Gui.Selection.clearSelection()
  13. Gui.Selection.addSelection(App.ActiveDocument.Body)
  14. App.ActiveDocument.recompute()
  15. App.activeDocument().Body.newObject('Sketcher::SketchObject','Sketch')
  16. App.activeDocument().Sketch.Support =
  17. (App.activeDocument().XY_Plane, [''])
  18. App.activeDocument().Sketch.MapMode = 'FlatFace'
  19. App.ActiveDocument.recompute()
  20. Gui.activeDocument().setEdit('Sketch')
  21. Gui.activateWorkbench('SketcherWorkbench') import PartDesignGui
  22. import Show.TempoVis ActiveSketch =
  23. App.ActiveDocument.getObject('Sketch') tv =
  24. Show.TempoVis(App.ActiveDocument) if
  25. ActiveSketch.ViewObject.HideDependent:   objs =
  26. tv.get_all_dependent(ActiveSketch)   objs = filter(lambda x: not
  27. x.TypeId.startswith("TechDraw::"), objs)   objs = filter(lambda x:
  28. not x.TypeId.startswith("Drawing::"), objs)   tv.hide(objs) if
  29. ActiveSketch.ViewObject.ShowSupport:   tv.show([ref[0] for ref in
  30. ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
  31. if ActiveSketch.ViewObject.ShowLinks:   tv.show([ref[0] for ref
  32. in ActiveSketch.ExternalGeometry]) tv.hide(ActiveSketch)
  33. ActiveSketch.ViewObject.TempoVis = tv del(tv) ActiveSketch
  34. = App.ActiveDocument.getObject('Sketch') if
  35. ActiveSketch.ViewObject.RestoreCamera:  
  36. ActiveSketch.ViewObject.TempoVis.saveCamera()
  37. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(1.750796,2.095233,0),App.Vector(16.548586,2.016101,0)),False)
  38. App.ActiveDocument.recompute()
  39. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(16.548586,2.016101,0),App.Vector(16.548586,6.843186,0)),False)
  40.  
  41. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',0,2,1,1))
  42. App.ActiveDocument.recompute() App.ActiveDocument.recompute()
  43.  
  44. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(16.548586,6.843186,0),App.Vector(13.383286,9.217163,0)),False)
  45.  
  46. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',1,2,2,1))
  47. App.ActiveDocument.recompute() App.ActiveDocument.recompute()
  48.  
  49. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(13.383286,9.217163,0),App.Vector(5.707422,9.138032,0)),False)
  50.  
  51. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',2,2,3,1))
  52. App.ActiveDocument.recompute() App.ActiveDocument.recompute()
  53.  
  54. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(5.707422,9.138032,0),App.Vector(8.242678,40.268314,0)),False)
  55.  
  56. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',3,2,4,1))
  57. App.ActiveDocument.recompute() App.ActiveDocument.recompute()
  58.  
  59. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(8.242678,40.268314,0),App.Vector(12.436702,40.268314,0)),False)
  60.  
  61. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',4,2,5,1))
  62. App.ActiveDocument.recompute() App.ActiveDocument.recompute()
  63.  
  64. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(12.436702,40.268314,0),App.Vector(12.516499,48.836342,0)),False)
  65.  
  66. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',5,2,6,1))
  67. App.ActiveDocument.recompute() App.ActiveDocument.recompute()
  68.  
  69. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(12.516499,48.836342,0),App.Vector(1.279675,48.836342,0)),False)
  70.  
  71. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',6,2,7,1))
  72. App.ActiveDocument.recompute() App.ActiveDocument.recompute()
  73.  
  74. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(1.279675,48.836342,0),App.Vector(1.673546,2.036575,0)),False)
  75.  
  76. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',7,2,8,1))
  77.  
  78. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',8,2,0,1))
  79. App.ActiveDocument.recompute() App.ActiveDocument.recompute()
  80.  
  81. App.ActiveDocument.Sketch.movePoint(3,0,App.Vector(0.079133,0.000000,0),1)
  82. App.ActiveDocument.recompute()
  83. App.ActiveDocument.Sketch.movePoint(0,0,App.Vector(0.079131,-0.553928,0),1)
  84. App.ActiveDocument.recompute()
  85. App.ActiveDocument.Sketch.movePoint(8,0,App.Vector(-1.107852,-0.079132,0),1)
  86. App.ActiveDocument.recompute()
  87. App.ActiveDocument.Sketch.movePoint(7,0,App.Vector(0.000000,0.236103,0),1)
  88. App.ActiveDocument.recompute()
  89. App.ActiveDocument.Sketch.movePoint(0,0,App.Vector(-0.472212,-0.118052,0),1)
  90. App.ActiveDocument.recompute()
  91. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('PointOnObject',0,1,-2))
  92.  
  93. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',8,2,8,1,47.707850))
  94. App.ActiveDocument.Sketch.setDatum(10,App.Units.Quantity('64.000000
  95. mm')) App.ActiveDocument.recompute()
  96. App.ActiveDocument.recompute() Gui.SendMsgToActiveView("ViewFit")
  97.  
  98. App.ActiveDocument.Sketch.movePoint(6,2,App.Vector(13.754119,59.233494,0),0)
  99. App.ActiveDocument.recompute()
  100. App.ActiveDocument.Sketch.movePoint(0,2,App.Vector(16.970783,-4.540214,0),0)
  101. App.ActiveDocument.recompute()
  102. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Horizontal',0))
  103. App.ActiveDocument.recompute()
  104. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Horizontal',7))
  105. App.ActiveDocument.recompute()
  106. App.ActiveDocument.Sketch.movePoint(0,0,App.Vector(0.000000,6.153603,0),1)
  107. App.ActiveDocument.recompute()
  108. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',0,1,-1,1))
  109. App.ActiveDocument.recompute()
  110. App.ActiveDocument.Sketch.movePoint(0,0,App.Vector(0.139852,-1.538401,0),1)
  111. App.ActiveDocument.recompute()
  112. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Vertical',8))
  113. App.ActiveDocument.recompute()
  114. App.ActiveDocument.Sketch.movePoint(7,0,App.Vector(2.377520,-0.839123,0),1)
  115. App.ActiveDocument.recompute()
  116. App.ActiveDocument.Sketch.movePoint(5,0,App.Vector(0.419564,16.223137,0),1)
  117. App.ActiveDocument.recompute()
  118. App.ActiveDocument.Sketch.movePoint(6,0,App.Vector(4.335495,-0.139851,0),1)
  119. App.ActiveDocument.recompute()
  120. App.ActiveDocument.Sketch.movePoint(6,2,App.Vector(18.369322,64.000000,0),0)
  121. App.ActiveDocument.recompute()
  122. App.ActiveDocument.Sketch.movePoint(3,0,App.Vector(0.139856,0.559419,0),1)
  123. App.ActiveDocument.recompute()
  124. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Horizontal',3))
  125. App.ActiveDocument.recompute()
  126. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Horizontal',4))
  127. App.ActiveDocument.recompute()
  128. App.ActiveDocument.Sketch.setVirtualSpace(9, True)
  129. App.ActiveDocument.recompute()
  130. App.ActiveDocument.Sketch.delConstraint(15)
  131. App.ActiveDocument.recompute()
  132. App.ActiveDocument.Sketch.movePoint(1,2,App.Vector(17.110634,6.788010,0),0)
  133.  App.ActiveDocument.recompute()
  134. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',0,1,0,2,17.110635))
  135. App.ActiveDocument.Sketch.setDatum(16,App.Units.Quantity('18.000000 mm'))
  136. App.ActiveDocument.recompute()
  137. App.ActiveDocument.recompute()
  138. App.ActiveDocument.Sketch.delConstraint(9)
  139. App.ActiveDocument.recompute()
  140. App.ActiveDocument.Sketch.movePoint(1,0,App.Vector(2.237684,0.139855,0),1)
  141. App.ActiveDocument.recompute()
  142. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',0,1,0,2,19.348319))
  143. App.ActiveDocument.Sketch.setDatum(15,App.Units.Quantity('18.000000 mm'))
  144. App.ActiveDocument.recompute()
  145. App.ActiveDocument.recompute()
  146. App.ActiveDocument.Sketch.movePoint(1,2,App.Vector(18.089615,7.766992,0),0)
  147. App.ActiveDocument.recompute()
  148. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',1,1,1,2,7.766992))
  149. App.ActiveDocument.Sketch.setDatum(16,App.Units.Quantity('6.000000 mm'))
  150. App.ActiveDocument.recompute()
  151. App.ActiveDocument.recompute()
  152. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',1,2,2,2,3.776582))
  153. App.ActiveDocument.Sketch.setDatum(17,App.Units.Quantity('3.000000 mm'))
  154. App.ActiveDocument.recompute()
  155. App.ActiveDocument.recompute()
  156. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(8.859208,12.941614,0),0)
  157. App.ActiveDocument.recompute()
  158. App.ActiveDocument.Sketch.movePoint(3,2,App.Vector(13.194703,13.081468,0),0)
  159. App.ActiveDocument.recompute()
  160. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(7.460668,12.801758,0),0)
  161. App.ActiveDocument.recompute()
  162. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(5.642550,12.941614,0),0)
  163. App.ActiveDocument.recompute()
  164. App.ActiveDocument.Sketch.movePoint(3,2,App.Vector(13.893976,12.941614,0),0)
  165. App.ActiveDocument.recompute()
  166. App.ActiveDocument.Sketch.movePoint(3,2,App.Vector(13.334559,12.102485,0),0)
  167. App.ActiveDocument.recompute()
  168. App.ActiveDocument.Sketch.movePoint(3,2,App.Vector(14.033833,11.403213,0),0)
  169. App.ActiveDocument.recompute()
  170. App.ActiveDocument.Sketch.delConstraintOnPoint(0,1)
  171. App.ActiveDocument.Sketch.delGeometry(3)
  172. App.ActiveDocument.recompute()
  173. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',3,1,2,2))
  174. App.ActiveDocument.recompute()
  175. App.ActiveDocument.Sketch.movePoint(3,0,App.Vector(0.279708,0.000000,0),1)
  176. App.ActiveDocument.recompute()
  177. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',2,2,1,2,3.776074))
  178. App.ActiveDocument.Sketch.setDatum(15,App.Units.Quantity('3.000000 mm'))
  179. App.ActiveDocument.recompute()
  180. App.ActiveDocument.recompute()
  181. App.ActiveDocument.Sketch.movePoint(3,2,App.Vector(6.481688,8.885829,0),0)
  182. App.ActiveDocument.recompute()
  183. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(10.397604,56.855965,0),0)
  184. App.ActiveDocument.recompute()
  185. App.ActiveDocument.Sketch.movePoint(5,2,App.Vector(16.970783,65.526947,0),0)
  186. App.ActiveDocument.recompute()
  187. App.ActiveDocument.Sketch.delConstraintOnPoint(4,2)
  188. App.ActiveDocument.recompute()
  189. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(7.320812,53.219746,0),0)
  190. App.ActiveDocument.recompute()
  191. App.ActiveDocument.Sketch.movePoint(5,1,App.Vector(16.830927,56.436398,0),0)
  192. App.ActiveDocument.recompute()
  193. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(6.901252,56.296543,0),0)
  194. App.ActiveDocument.recompute()
  195. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(6.901252,56.296543,0),App.Vector(16.830927,56.436398,0)),False)
  196. App.ActiveDocument.recompute()
  197. App.ActiveDocument.Sketch.movePoint(8,0,App.Vector(0.000000,2.237675,0),1)
  198. App.ActiveDocument.recompute()
  199. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',8,1,4,2))
  200. App.ActiveDocument.recompute()
  201. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',8,2,5,1))
  202. App.ActiveDocument.recompute()
  203. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(8.020084,58.394363,0),0)
  204. App.ActiveDocument.recompute()
  205. App.ActiveDocument.Sketch.movePoint(5,1,App.Vector(16.691071,54.758141,0),0)
  206. App.ActiveDocument.recompute()
  207. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(10.117901,54.618290,0),0)
  208. App.ActiveDocument.recompute()
  209. App.ActiveDocument.Sketch.movePoint(5,1,App.Vector(16.830927,52.240761,0),0)
  210. App.ActiveDocument.recompute()
  211. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(9.978045,52.240761,0),0)
  212. App.ActiveDocument.recompute()
  213. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',6,2,6,1,16.970783))
  214. App.ActiveDocument.Sketch.setDatum(17,App.Units.Quantity('16.000000 mm'))
  215. App.ActiveDocument.recompute()
  216. App.ActiveDocument.recompute()
  217. App.ActiveDocument.Sketch.movePoint(0,0,App.Vector(2.517372,1.818110,0),1)
  218. App.ActiveDocument.recompute()
  219. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',7,2,0,1))
  220. App.ActiveDocument.recompute()
  221. App.ActiveDocument.Sketch.movePoint(7,0,App.Vector(0.000000,-0.978981,0),1)
  222. App.ActiveDocument.recompute()
  223. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',0,1,-1,1))
  224. App.ActiveDocument.recompute()
  225. App.ActiveDocument.Sketch.movePoint(5,1,App.Vector(16.131655,52.380615,0),0)
  226. App.ActiveDocument.recompute()
  227. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',5,1,5,2,11.619385))
  228. App.ActiveDocument.Sketch.setDatum(20,App.Units.Quantity('12.000000 mm'))
  229. App.ActiveDocument.recompute()
  230. App.ActiveDocument.recompute()
  231. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Horizontal',8))
  232. App.ActiveDocument.recompute()
  233. App.ActiveDocument.recompute()
  234. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',0,1,4,2,9.978045))
  235. App.ActiveDocument.Sketch.setDatum(22,App.Units.Quantity('10.000000 mm'))
  236. App.ActiveDocument.recompute()
  237. App.ActiveDocument.recompute()
  238. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',0,1,3,2,6.481688))
  239. App.ActiveDocument.Sketch.setDatum(23,App.Units.Quantity('6.000000 mm'))
  240. App.ActiveDocument.recompute()
  241. App.ActiveDocument.recompute()
  242. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Vertical',1))
  243. App.ActiveDocument.recompute()
  244. App.ActiveDocument.Sketch.movePoint(4,0,App.Vector(3.636223,0.000000,0),1)
  245. App.ActiveDocument.recompute()
  246. App.ActiveDocument.Sketch.movePoint(8,0,App.Vector(0.000000,-1.398548,0),1)
  247. App.ActiveDocument.recompute()
  248. App.ActiveDocument.Sketch.movePoint(4,2,App.Vector(7.740376,52.380615,0),0)
  249. App.ActiveDocument.recompute()
  250. App.ActiveDocument.Sketch.movePoint(6,0,App.Vector(0.279708,0.279709,0),1)
  251. App.ActiveDocument.recompute()
  252. App.ActiveDocument.Sketch.movePoint(2,0,App.Vector(-1.957975,-0.559418,0),1)
  253. App.ActiveDocument.recompute()
  254. App.ActiveDocument.Sketch.movePoint(3,0,App.Vector(0.000000,2.377527,0),1)
  255. App.ActiveDocument.recompute()
  256. App.ActiveDocument.Sketch.movePoint(0,0,App.Vector(0.000000,-1.118837,0),1)
  257. App.ActiveDocument.recompute()
  258. App.ActiveDocument.Sketch.movePoint(7,0,App.Vector(-2.657228,-0.419564,0),1)
  259. App.ActiveDocument.recompute()
  260. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',4,2,0,1,-10.000000))
  261. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',4,2,0,1,-52.000000))
  262. App.ActiveDocument.recompute()
  263. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',0,1,3,2,9.000000))
  264. App.ActiveDocument.recompute()
  265. App.ActiveDocument.recompute()
  266. Gui.getDocument('Unnamed').resetEdit()
  267. ActiveSketch = App.ActiveDocument.getObject('Sketch')
  268. tv = ActiveSketch.ViewObject.TempoVis
  269. if tv:
  270.   tv.restore()
  271. ActiveSketch.ViewObject.TempoVis = None
  272. del(tv)
  273.  
  274. Gui.activateWorkbench('PartDesignWorkbench')
  275. App.getDocument('Unnamed').recompute()
  276. App.activeDocument().Body.newObject("PartDesign::Revolution","Revolution")
  277. App.activeDocument().Revolution.Profile = App.activeDocument().Sketch
  278. App.activeDocument().Revolution.ReferenceAxis = (App.activeDocument().Sketch,['V_Axis'])
  279. App.activeDocument().Revolution.Angle = 360.0
  280. App.activeDocument().Revolution.Reversed = 1
  281. Gui.activeDocument().hide("Sketch")
  282. App.ActiveDocument.recompute()
  283. Gui.ActiveDocument.Revolution.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  284. Gui.ActiveDocument.Revolution.LineColor=Gui.ActiveDocument.Body.LineColor
  285. Gui.ActiveDocument.Revolution.PointColor=Gui.ActiveDocument.Body.PointColor
  286. Gui.ActiveDocument.Revolution.Transparency=Gui.ActiveDocument.Body.Transparency
  287. Gui.ActiveDocument.Revolution.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  288. Gui.activeDocument().setEdit('Revolution', 0)
  289. Gui.Selection.clearSelection()
  290. Gui.activeDocument().hide("Sketch")
  291. App.ActiveDocument.Revolution.Angle = 360.000000
  292. App.ActiveDocument.Revolution.ReferenceAxis = (App.ActiveDocument.Sketch, ["V_Axis"])
  293. App.ActiveDocument.Revolution.Midplane = 0
  294. App.ActiveDocument.Revolution.Reversed = 1
  295. App.ActiveDocument.recompute()
  296. Gui.activeDocument().resetEdit()
  297. App.activeDocument().Body.Tip = None
  298. App.ActiveDocument.recompute()
  299. Gui.activateWorkbench('SketcherWorkbench')
  300. import PartDesignGui
  301. ActiveSketch = App.ActiveDocument.getObject('Sketch')
  302. tv = Show.TempoVis(App.ActiveDocument)
  303. if ActiveSketch.ViewObject.HideDependent:
  304.   objs = tv.get_all_dependent(ActiveSketch)
  305.   objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs)
  306.   objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs)
  307.   tv.hide(objs)
  308. if ActiveSketch.ViewObject.ShowSupport:
  309.   tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
  310. if ActiveSketch.ViewObject.ShowLinks:
  311.   tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
  312. tv.hide(ActiveSketch)
  313. ActiveSketch.ViewObject.TempoVis = tv
  314. del(tv)
  315.  
  316. ActiveSketch = App.ActiveDocument.getObject('Sketch')
  317. if ActiveSketch.ViewObject.RestoreCamera:
  318.   ActiveSketch.ViewObject.TempoVis.saveCamera()
  319.  
  320. App.ActiveDocument.Sketch.delConstraint(20)
  321. App.ActiveDocument.recompute()
  322. App.ActiveDocument.Sketch.movePoint(5,2,App.Vector(18.623659,63.722214,0),0)
  323. App.ActiveDocument.recompute()
  324. App.ActiveDocument.Sketch.delConstraint(17)
  325. App.ActiveDocument.recompute()
  326. App.ActiveDocument.Sketch.movePoint(5,2,App.Vector(21.955362,63.116451,0),0)
  327. App.ActiveDocument.recompute()
  328. App.ActiveDocument.Sketch.movePoint(8,0,App.Vector(-0.757206,-7.117737,0),1)
  329. App.ActiveDocument.recompute()
  330. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',6,2,6,1,21.955362))
  331. App.ActiveDocument.Sketch.setDatum(23,App.Units.Quantity('18.000000 mm'))
  332. App.ActiveDocument.recompute()
  333. App.ActiveDocument.recompute()
  334. App.ActiveDocument.Sketch.setDatum(20,App.Units.Quantity('7.000000 mm'))
  335. App.ActiveDocument.recompute()
  336. App.ActiveDocument.Sketch.setDatum(21,App.Units.Quantity('3.000000 mm'))
  337. App.ActiveDocument.recompute()
  338. App.ActiveDocument.Sketch.movePoint(8,0,App.Vector(-0.151439,1.060085,0),1)
  339. App.ActiveDocument.recompute()
  340. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',5,1,5,2,18.057652))
  341. App.ActiveDocument.Sketch.setDatum(24,App.Units.Quantity('18.060000 mm'))
  342. App.ActiveDocument.recompute()
  343. App.ActiveDocument.recompute()
  344. App.ActiveDocument.Sketch.movePoint(8,0,App.Vector(-1.060094,0.454315,0),1)
  345. App.ActiveDocument.recompute()
  346. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',8,1,8,2,7.162916))
  347. App.ActiveDocument.Sketch.setDatum(25,App.Units.Quantity('7.000000 mm'))
  348. App.ActiveDocument.recompute()
  349. App.ActiveDocument.recompute()
  350. Gui.getDocument('Unnamed').resetEdit()
  351. ActiveSketch = App.ActiveDocument.getObject('Sketch')
  352. tv = ActiveSketch.ViewObject.TempoVis
  353. if tv:
  354.   tv.restore()
  355. ActiveSketch.ViewObject.TempoVis = None
  356. del(tv)
  357.  
  358. Gui.activateWorkbench('PartDesignWorkbench')
  359. App.getDocument('Unnamed').recompute()
  360. Gui.activateWorkbench('SketcherWorkbench')
  361. import PartDesignGui
  362. ActiveSketch = App.ActiveDocument.getObject('Sketch')
  363. tv = Show.TempoVis(App.ActiveDocument)
  364. if ActiveSketch.ViewObject.HideDependent:
  365.   objs = tv.get_all_dependent(ActiveSketch)
  366.   objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs)
  367.   objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs)
  368.   tv.hide(objs)
  369. if ActiveSketch.ViewObject.ShowSupport:
  370.   tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
  371. if ActiveSketch.ViewObject.ShowLinks:
  372.   tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
  373. tv.hide(ActiveSketch)
  374. ActiveSketch.ViewObject.TempoVis = tv
  375. del(tv)
  376.  
  377. ActiveSketch = App.ActiveDocument.getObject('Sketch')
  378. if ActiveSketch.ViewObject.RestoreCamera:
  379.   ActiveSketch.ViewObject.TempoVis.saveCamera()
  380.  
  381. App.ActiveDocument.Sketch.delConstraint(25)
  382. App.ActiveDocument.recompute()
  383. App.ActiveDocument.Sketch.delConstraintOnPoint(5,1)
  384. App.ActiveDocument.recompute()
  385. App.ActiveDocument.Sketch.delConstraint(23)
  386. App.ActiveDocument.recompute()
  387. App.ActiveDocument.Sketch.movePoint(5,1,App.Vector(9.839961,48.729527,0),0)
  388. App.ActiveDocument.recompute()
  389. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(9.839961,48.729527,0),App.Vector(16.503380,48.729527,0)),False)
  390. App.ActiveDocument.recompute()
  391. App.ActiveDocument.Sketch.delGeometry(8)
  392. App.ActiveDocument.recompute()
  393. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(7.000000,45.939999,0),App.Vector(17.109142,46.003578,0)),False)
  394. App.ActiveDocument.recompute()
  395. App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(App.Vector(17.109142,46.003578,0),App.Vector(16.503380,48.729527,0)),False)
  396. App.ActiveDocument.recompute()
  397. App.ActiveDocument.Sketch.movePoint(8,2,App.Vector(16.806261,51.152588,0),0)
  398. App.ActiveDocument.recompute()
  399. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',8,2,10,2))
  400. App.ActiveDocument.recompute()
  401. App.ActiveDocument.Sketch.movePoint(8,2,App.Vector(16.806261,48.880966,0),0)
  402. App.ActiveDocument.recompute()
  403. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Vertical',10))
  404. App.ActiveDocument.recompute()
  405. App.ActiveDocument.Sketch.movePoint(5,1,App.Vector(6.811135,48.729527,0),0)
  406. App.ActiveDocument.recompute()
  407. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',8,1,5,1))
  408. App.ActiveDocument.recompute()
  409. App.ActiveDocument.Sketch.movePoint(5,1,App.Vector(7.114017,48.880966,0),0)
  410. App.ActiveDocument.recompute()
  411. App.ActiveDocument.Sketch.movePoint(10,0,App.Vector(3.937479,0.151440,0),1)
  412. App.ActiveDocument.recompute()
  413. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',10,1,9,2))
  414. App.ActiveDocument.recompute()
  415. App.ActiveDocument.Sketch.movePoint(9,0,App.Vector(2.271618,-0.151447,0),1)
  416. App.ActiveDocument.recompute()
  417. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Coincident',9,1,4,2))
  418. App.ActiveDocument.recompute()
  419. App.ActiveDocument.Sketch.movePoint(9,0,App.Vector(0.000000,0.151440,0),1)
  420. App.ActiveDocument.recompute()
  421. App.ActiveDocument.Sketch.movePoint(10,0,App.Vector(-6.360537,-0.151443,0),1)
  422. App.ActiveDocument.recompute()
  423. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Parallel',9,8))
  424. App.ActiveDocument.recompute()
  425. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',10,1,10,2,2.940246))
  426. App.ActiveDocument.Sketch.setDatum(27,App.Units.Quantity('2.500000 mm'))
  427. App.ActiveDocument.recompute()
  428. App.ActiveDocument.recompute()
  429. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('Horizontal',9))
  430. App.ActiveDocument.recompute()
  431. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',9,1,9,2,9.957494))
  432. App.ActiveDocument.Sketch.setDatum(29,App.Units.Quantity('9.960000 mm'))
  433. App.ActiveDocument.recompute()
  434. App.ActiveDocument.recompute()
  435. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',5,1,5,2,15.549687))
  436. App.ActiveDocument.Sketch.setDatum(30,App.Units.Quantity('15.000000 mm'))
  437. App.ActiveDocument.recompute()
  438. App.ActiveDocument.recompute()
  439. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceY',4,1,4,2,37.500000))
  440. App.ActiveDocument.recompute()
  441. App.ActiveDocument.recompute()
  442. App.ActiveDocument.Sketch.movePoint(5,0,App.Vector(0.151443,1.211529,0),1)
  443. App.ActiveDocument.recompute()
  444. App.ActiveDocument.Sketch.movePoint(6,0,App.Vector(0.151440,1.817299,0),1)
  445. App.ActiveDocument.recompute()
  446. App.ActiveDocument.Sketch.movePoint(3,0,App.Vector(0.151440,-0.454325,0),1)
  447. App.ActiveDocument.recompute()
  448. App.ActiveDocument.Sketch.movePoint(1,0,App.Vector(2.423059,-0.151441,0),1)
  449. App.ActiveDocument.recompute()
  450. App.ActiveDocument.Sketch.movePoint(2,0,App.Vector(-0.605764,-0.757206,0),1)
  451. App.ActiveDocument.recompute()
  452. App.ActiveDocument.Sketch.movePoint(0,0,App.Vector(0.151443,1.665855,0),1)
  453. App.ActiveDocument.recompute()
  454. App.ActiveDocument.Sketch.movePoint(5,0,App.Vector(-0.302882,0.908649,0),1)
  455. App.ActiveDocument.recompute()
  456. App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('DistanceX',6,2,5,1,6.962583))
  457. App.ActiveDocument.Sketch.setDatum(31,App.Units.Quantity('7.000000 mm'))
  458. App.ActiveDocument.recompute()
  459. App.ActiveDocument.recompute()
  460. App.ActiveDocument.Sketch.setDatum(20,App.Units.Quantity('15.000000 mm'))
  461. App.ActiveDocument.recompute()
  462. Gui.getDocument('Unnamed').resetEdit()
  463. ActiveSketch = App.ActiveDocument.getObject('Sketch')
  464. tv = ActiveSketch.ViewObject.TempoVis
  465. if tv:
  466.   tv.restore()
  467. ActiveSketch.ViewObject.TempoVis = None
  468. del(tv)
  469.  
  470. Gui.activateWorkbench('PartDesignWorkbench')
  471. App.getDocument('Unnamed').recompute()
  472. Gui.SendMsgToActiveView("SaveAs")
  473. App.getDocument("Unnamed").saveAs(u"/home/mark/Documents/Freecadprojects/ChessPieces/king.FCStd")
  474. App.activeDocument().Body.newObject('Sketcher::SketchObject','Sketch001')
  475. App.activeDocument().Sketch001.Support = (App.ActiveDocument.Revolution,["Face2"])
  476. App.activeDocument().Sketch001.MapMode = 'FlatFace'
  477. App.ActiveDocument.recompute()
  478. Gui.activeDocument().setEdit('Sketch001')
  479. Gui.activateWorkbench('SketcherWorkbench')
  480. import PartDesignGui
  481. ActiveSketch = App.ActiveDocument.getObject('Sketch001')
  482. tv = Show.TempoVis(App.ActiveDocument)
  483. if ActiveSketch.ViewObject.HideDependent:
  484.   objs = tv.get_all_dependent(ActiveSketch)
  485.   objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs)
  486.   objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs)
  487.   tv.hide(objs)
  488. if ActiveSketch.ViewObject.ShowSupport:
  489.   tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
  490. if ActiveSketch.ViewObject.ShowLinks:
  491.   tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
  492. tv.hide(ActiveSketch)
  493. ActiveSketch.ViewObject.TempoVis = tv
  494. del(tv)
  495.  
  496. ActiveSketch = App.ActiveDocument.getObject('Sketch001')
  497. if ActiveSketch.ViewObject.RestoreCamera:
  498.   ActiveSketch.ViewObject.TempoVis.saveCamera()
  499.  
  500. Gui.SendMsgToActiveView("ViewFit")
  501. geoList = []
  502. geoList.append(Part.LineSegment(App.Vector(-4.469319,8.712027,0),App.Vector(4.912869,8.712027,0)))
  503. geoList.append(Part.LineSegment(App.Vector(4.912869,8.712027,0),App.Vector(4.912869,-9.808660,0)))
  504. geoList.append(Part.LineSegment(App.Vector(4.912869,-9.808660,0),App.Vector(-4.469319,-9.808660,0)))
  505. geoList.append(Part.LineSegment(App.Vector(-4.469319,-9.808660,0),App.Vector(-4.469319,8.712027,0)))
  506. App.ActiveDocument.Sketch001.addGeometry(geoList,False)
  507. conList = []
  508. conList.append(Sketcher.Constraint('Coincident',0,2,1,1))
  509. conList.append(Sketcher.Constraint('Coincident',1,2,2,1))
  510. conList.append(Sketcher.Constraint('Coincident',2,2,3,1))
  511. conList.append(Sketcher.Constraint('Coincident',3,2,0,1))
  512. conList.append(Sketcher.Constraint('Horizontal',0))
  513. conList.append(Sketcher.Constraint('Horizontal',2))
  514. conList.append(Sketcher.Constraint('Vertical',1))
  515. conList.append(Sketcher.Constraint('Vertical',3))
  516. App.ActiveDocument.Sketch001.addConstraint(conList)
  517.  
  518. App.ActiveDocument.recompute()
  519. App.ActiveDocument.Sketch001.addConstraint(Sketcher.Constraint('Symmetric',0,1,2,2,-1))
  520. App.ActiveDocument.recompute()
  521. App.ActiveDocument.Sketch001.addConstraint(Sketcher.Constraint('Symmetric',0,1,0,2,-2))
  522. App.ActiveDocument.recompute()
  523. App.ActiveDocument.Sketch001.movePoint(2,0,App.Vector(0.974766,-1.218466,0),1)
  524. App.ActiveDocument.recompute()
  525. App.ActiveDocument.Sketch001.movePoint(1,0,App.Vector(-0.121845,-0.243692,0),1)
  526. App.ActiveDocument.recompute()
  527. App.ActiveDocument.Sketch001.movePoint(0,0,App.Vector(-0.121845,1.462161,0),1)
  528. App.ActiveDocument.recompute()
  529. App.ActiveDocument.Sketch001.addConstraint(Sketcher.Constraint('DistanceX',0,1,0,2,9.350269))
  530. App.ActiveDocument.Sketch001.setDatum(10,App.Units.Quantity('9.000000 mm'))
  531. App.ActiveDocument.recompute()
  532. App.ActiveDocument.recompute()
  533. App.ActiveDocument.Sketch001.delConstraint(4)
  534. App.ActiveDocument.recompute()
  535. App.ActiveDocument.Sketch001.delConstraint(5)
  536. App.ActiveDocument.recompute()
  537. App.ActiveDocument.Sketch001.delConstraint(5)
  538. App.ActiveDocument.recompute()
  539. App.ActiveDocument.Sketch001.delConstraint(4)
  540. App.ActiveDocument.recompute()
  541. App.ActiveDocument.Sketch001.addConstraint(Sketcher.Constraint('DistanceX',0,1,0,2,9.350269))
  542. App.ActiveDocument.Sketch001.setDatum(6,App.Units.Quantity('9.000000 mm'))
  543. App.ActiveDocument.recompute()
  544. App.ActiveDocument.recompute()
  545. App.ActiveDocument.Sketch001.addConstraint(Sketcher.Constraint('DistanceY',1,2,1,1,22.787522))
  546. App.ActiveDocument.Sketch001.setDatum(7,App.Units.Quantity('22.000000 mm'))
  547. App.ActiveDocument.recompute()
  548. App.ActiveDocument.recompute()
  549. App.ActiveDocument.Sketch001.addConstraint(Sketcher.Constraint('Vertical',1))
  550. App.ActiveDocument.recompute()
  551. App.ActiveDocument.Sketch001.addConstraint(Sketcher.Constraint('Horizontal',2))
  552. App.ActiveDocument.recompute()
  553. Gui.getDocument('Unnamed').resetEdit()
  554. ActiveSketch = App.ActiveDocument.getObject('Sketch001')
  555. tv = ActiveSketch.ViewObject.TempoVis
  556. if tv:
  557.   tv.restore()
  558. ActiveSketch.ViewObject.TempoVis = None
  559. del(tv)
  560.  
  561. Gui.activateWorkbench('PartDesignWorkbench')
  562. App.getDocument('Unnamed').recompute()
  563. App.activeDocument().Body.newObject("PartDesign::Pad","Pad")
  564. App.activeDocument().Pad.Profile = App.activeDocument().Sketch001
  565. App.activeDocument().Pad.Length = 10.0
  566. App.ActiveDocument.recompute()
  567. Gui.activeDocument().hide("Sketch001")
  568. App.ActiveDocument.recompute()
  569. Gui.ActiveDocument.Pad.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  570. Gui.ActiveDocument.Pad.LineColor=Gui.ActiveDocument.Body.LineColor
  571. Gui.ActiveDocument.Pad.PointColor=Gui.ActiveDocument.Body.PointColor
  572. Gui.ActiveDocument.Pad.Transparency=Gui.ActiveDocument.Body.Transparency
  573. Gui.ActiveDocument.Pad.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  574. Gui.activeDocument().setEdit('Pad', 0)
  575. Gui.Selection.clearSelection()
  576. Gui.activeDocument().hide("Sketch001")
  577. App.ActiveDocument.Pad.Length = 15.000000
  578. App.ActiveDocument.Pad.Length2 = 100.000000
  579. App.ActiveDocument.Pad.Type = 0
  580. App.ActiveDocument.Pad.UpToFace = None
  581. App.ActiveDocument.Pad.Reversed = 0
  582. App.ActiveDocument.Pad.Midplane = 0
  583. App.ActiveDocument.Pad.Offset = 0.000000
  584. Gui.activeDocument().hide("Revolution")
  585. App.ActiveDocument.recompute()
  586. Gui.activeDocument().resetEdit()
  587. App.activeDocument().Body.Tip = None
  588. App.ActiveDocument.recompute()
  589. Gui.activateWorkbench('SketcherWorkbench')
  590. import PartDesignGui
  591. ActiveSketch = App.ActiveDocument.getObject('Sketch001')
  592. tv = Show.TempoVis(App.ActiveDocument)
  593. if ActiveSketch.ViewObject.HideDependent:
  594.   objs = tv.get_all_dependent(ActiveSketch)
  595.   objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs)
  596.   objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs)
  597.   tv.hide(objs)
  598. if ActiveSketch.ViewObject.ShowSupport:
  599.   tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
  600. if ActiveSketch.ViewObject.ShowLinks:
  601.   tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
  602. tv.hide(ActiveSketch)
  603. ActiveSketch.ViewObject.TempoVis = tv
  604. del(tv)
  605.  
  606. ActiveSketch = App.ActiveDocument.getObject('Sketch001')
  607. if ActiveSketch.ViewObject.RestoreCamera:
  608.   ActiveSketch.ViewObject.TempoVis.saveCamera()
  609.  
  610. App.ActiveDocument.Sketch001.setDatum(6,App.Units.Quantity('6.000000 mm'))
  611. App.ActiveDocument.recompute()
  612. App.ActiveDocument.Sketch001.setDatum(7,App.Units.Quantity('18.000000 mm'))
  613. App.ActiveDocument.recompute()
  614. Gui.getDocument('Unnamed').resetEdit()
  615. ActiveSketch = App.ActiveDocument.getObject('Sketch001')
  616. tv = ActiveSketch.ViewObject.TempoVis
  617. if tv:
  618.   tv.restore()
  619. ActiveSketch.ViewObject.TempoVis = None
  620. del(tv)
  621.  
  622. Gui.activateWorkbench('PartDesignWorkbench')
  623. App.getDocument('Unnamed').recompute()
  624. App.activeDocument().Body.newObject('Sketcher::SketchObject','Sketch002')
  625. App.activeDocument().Sketch002.Support = (App.ActiveDocument.Pad,["Face6"])
  626. App.activeDocument().Sketch002.MapMode = 'FlatFace'
  627. App.ActiveDocument.recompute()
  628. Gui.activeDocument().setEdit('Sketch002')
  629. Gui.activateWorkbench('SketcherWorkbench')
  630. import PartDesignGui
  631. ActiveSketch = App.ActiveDocument.getObject('Sketch002')
  632. tv = Show.TempoVis(App.ActiveDocument)
  633. if ActiveSketch.ViewObject.HideDependent:
  634.   objs = tv.get_all_dependent(ActiveSketch)
  635.   objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs)
  636.   objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs)
  637.   tv.hide(objs)
  638. if ActiveSketch.ViewObject.ShowSupport:
  639.   tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
  640. if ActiveSketch.ViewObject.ShowLinks:
  641.   tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
  642. tv.hide(ActiveSketch)
  643. ActiveSketch.ViewObject.TempoVis = tv
  644. del(tv)
  645.  
  646. ActiveSketch = App.ActiveDocument.getObject('Sketch002')
  647. if ActiveSketch.ViewObject.RestoreCamera:
  648.   ActiveSketch.ViewObject.TempoVis.saveCamera()
  649.  
  650. Gui.SendMsgToActiveView("ViewFit")
  651. geoList = []
  652. geoList.append(Part.LineSegment(App.Vector(-74.156960,10.152035,0),App.Vector(-69.395996,10.152035,0)))
  653. geoList.append(Part.LineSegment(App.Vector(-69.395996,10.152035,0),App.Vector(-69.395996,3.430689,0)))
  654. geoList.append(Part.LineSegment(App.Vector(-69.395996,3.430689,0),App.Vector(-74.156960,3.430689,0)))
  655. geoList.append(Part.LineSegment(App.Vector(-74.156960,3.430689,0),App.Vector(-74.156960,10.152035,0)))
  656. App.ActiveDocument.Sketch002.addGeometry(geoList,False)
  657. conList = []
  658. conList.append(Sketcher.Constraint('Coincident',0,2,1,1))
  659. conList.append(Sketcher.Constraint('Coincident',1,2,2,1))
  660. conList.append(Sketcher.Constraint('Coincident',2,2,3,1))
  661. conList.append(Sketcher.Constraint('Coincident',3,2,0,1))
  662. conList.append(Sketcher.Constraint('Horizontal',0))
  663. conList.append(Sketcher.Constraint('Horizontal',2))
  664. conList.append(Sketcher.Constraint('Vertical',1))
  665. conList.append(Sketcher.Constraint('Vertical',3))
  666. App.ActiveDocument.Sketch002.addConstraint(conList)
  667.  
  668. App.ActiveDocument.recompute()
  669. App.ActiveDocument.Sketch002.movePoint(3,0,App.Vector(0.700142,0.000000,0),1)
  670. App.ActiveDocument.recompute()
  671. App.ActiveDocument.Sketch002.movePoint(2,0,App.Vector(2.520508,0.000000,0),1)
  672. App.ActiveDocument.recompute()
  673. App.ActiveDocument.Sketch002.movePoint(0,0,App.Vector(0.000000,-0.980196,0),1)
  674. App.ActiveDocument.recompute()
  675. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceX',0,2,-66.875488))
  676. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceY',0,2,9.171839))
  677. App.ActiveDocument.recompute()
  678. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceY',1,2,1,1,5.741150))
  679. App.ActiveDocument.Sketch002.setDatum(10,App.Units.Quantity('5.000000 mm'))
  680. App.ActiveDocument.recompute()
  681. App.ActiveDocument.recompute()
  682. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceX',0,1,0,2,4.060822))
  683. App.ActiveDocument.Sketch002.setDatum(11,App.Units.Quantity('5.060000 mm'))
  684. App.ActiveDocument.recompute()
  685. App.ActiveDocument.recompute()
  686. App.ActiveDocument.Sketch002.setDatum(9,App.Units.Quantity('8.000000 mm'))
  687. App.ActiveDocument.recompute()
  688. App.ActiveDocument.Sketch002.setDatum(8,App.Units.Quantity('-66.880000 mm'))
  689. App.ActiveDocument.recompute()
  690. App.ActiveDocument.Sketch002.setDatum(8,App.Units.Quantity('-60.000000 mm'))
  691. App.ActiveDocument.recompute()
  692. App.ActiveDocument.Sketch002.setDatum(8,App.Units.Quantity('-64.000000 mm'))
  693. App.ActiveDocument.recompute()
  694. App.ActiveDocument.Sketch002.setDatum(8,App.Units.Quantity('-66.000000 mm'))
  695. App.ActiveDocument.recompute()
  696. geoList = []
  697. geoList.append(Part.LineSegment(App.Vector(-78.917915,8.891786,0),App.Vector(-75.277184,8.891786,0)))
  698. geoList.append(Part.LineSegment(App.Vector(-75.277184,8.891786,0),App.Vector(-75.277184,3.710747,0)))
  699. geoList.append(Part.LineSegment(App.Vector(-75.277184,3.710747,0),App.Vector(-78.917915,3.710747,0)))
  700. geoList.append(Part.LineSegment(App.Vector(-78.917915,3.710747,0),App.Vector(-78.917915,8.891786,0)))
  701. App.ActiveDocument.Sketch002.addGeometry(geoList,False)
  702. conList = []
  703. conList.append(Sketcher.Constraint('Coincident',4,2,5,1))
  704. conList.append(Sketcher.Constraint('Coincident',5,2,6,1))
  705. conList.append(Sketcher.Constraint('Coincident',6,2,7,1))
  706. conList.append(Sketcher.Constraint('Coincident',7,2,4,1))
  707. conList.append(Sketcher.Constraint('Horizontal',4))
  708. conList.append(Sketcher.Constraint('Horizontal',6))
  709. conList.append(Sketcher.Constraint('Vertical',5))
  710. conList.append(Sketcher.Constraint('Vertical',7))
  711. App.ActiveDocument.Sketch002.addConstraint(conList)
  712.  
  713. App.ActiveDocument.recompute()
  714. App.ActiveDocument.Sketch002.movePoint(6,0,App.Vector(0.000000,0.420085,0),1)
  715. App.ActiveDocument.recompute()
  716. App.ActiveDocument.Sketch002.movePoint(4,0,App.Vector(0.000000,0.420085,0),1)
  717. App.ActiveDocument.recompute()
  718. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceX',4,2,-75.277184))
  719. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceY',4,2,9.311871))
  720. App.ActiveDocument.recompute()
  721. App.ActiveDocument.Sketch002.setDatum(21,App.Units.Quantity('9.170000 mm'))
  722. App.ActiveDocument.recompute()
  723. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceX',4,1,4,2,3.640731))
  724. App.ActiveDocument.Sketch002.setDatum(22,App.Units.Quantity('3.640000 mm'))
  725. App.ActiveDocument.recompute()
  726. App.ActiveDocument.recompute()
  727. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceY',7,1,7,2,5.039168))
  728. App.ActiveDocument.Sketch002.setDatum(23,App.Units.Quantity('5.000000 mm'))
  729. App.ActiveDocument.recompute()
  730. App.ActiveDocument.recompute()
  731. App.ActiveDocument.Sketch002.addSymmetric([0,1,2,3,4,5,6],7,0)
  732. App.ActiveDocument.recompute()
  733. App.ActiveDocument.Sketch002.addSymmetric([0,1,2,3,4,5,6],7,0)
  734. App.ActiveDocument.recompute()
  735. App.ActiveDocument.Sketch002.addSymmetric([0,1,2,3,4,5,6,7],-1,0)
  736. App.ActiveDocument.recompute()
  737. Gui.getDocument('Unnamed').resetEdit()
  738. ActiveSketch = App.ActiveDocument.getObject('Sketch002')
  739. tv = ActiveSketch.ViewObject.TempoVis
  740. if tv:
  741.   tv.restore()
  742. ActiveSketch.ViewObject.TempoVis = None
  743. del(tv)
  744.  
  745. Gui.activateWorkbench('PartDesignWorkbench')
  746. App.getDocument('Unnamed').recompute()
  747. App.activeDocument().Body.newObject("PartDesign::Pocket","Pocket")
  748. App.activeDocument().Pocket.Profile = App.activeDocument().Sketch002
  749. App.activeDocument().Pocket.Length = 5.0
  750. Gui.activeDocument().hide("Sketch002")
  751. App.ActiveDocument.recompute()
  752. Gui.ActiveDocument.Pocket.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  753. Gui.ActiveDocument.Pocket.LineColor=Gui.ActiveDocument.Body.LineColor
  754. Gui.ActiveDocument.Pocket.PointColor=Gui.ActiveDocument.Body.PointColor
  755. Gui.ActiveDocument.Pocket.Transparency=Gui.ActiveDocument.Body.Transparency
  756. Gui.ActiveDocument.Pocket.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  757. Gui.activeDocument().setEdit('Pocket', 0)
  758. Gui.Selection.clearSelection()
  759. Gui.activeDocument().resetEdit()
  760. Gui.activateWorkbench('SketcherWorkbench')
  761. import PartDesignGui
  762. ActiveSketch = App.ActiveDocument.getObject('Sketch002')
  763. tv = Show.TempoVis(App.ActiveDocument)
  764. if ActiveSketch.ViewObject.HideDependent:
  765.   objs = tv.get_all_dependent(ActiveSketch)
  766.   objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs)
  767.   objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs)
  768.   tv.hide(objs)
  769. if ActiveSketch.ViewObject.ShowSupport:
  770.   tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
  771. if ActiveSketch.ViewObject.ShowLinks:
  772.   tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
  773. tv.hide(ActiveSketch)
  774. ActiveSketch.ViewObject.TempoVis = tv
  775. del(tv)
  776.  
  777. ActiveSketch = App.ActiveDocument.getObject('Sketch002')
  778. if ActiveSketch.ViewObject.RestoreCamera:
  779.   ActiveSketch.ViewObject.TempoVis.saveCamera()
  780.  
  781. App.ActiveDocument.Sketch002.setDatum(22,App.Units.Quantity('4.000000 mm'))
  782. App.ActiveDocument.recompute()
  783. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceX',12,1,12,2,3.640000))
  784. App.ActiveDocument.Sketch002.setDatum(40,App.Units.Quantity('4.000000 mm'))
  785. App.ActiveDocument.recompute()
  786. App.ActiveDocument.recompute()
  787. Gui.getDocument('Unnamed').resetEdit()
  788. ActiveSketch = App.ActiveDocument.getObject('Sketch002')
  789. tv = ActiveSketch.ViewObject.TempoVis
  790. if tv:
  791.   tv.restore()
  792. ActiveSketch.ViewObject.TempoVis = None
  793. del(tv)
  794.  
  795. Gui.activateWorkbench('PartDesignWorkbench')
  796. App.getDocument('Unnamed').recompute()
  797. App.activeDocument().Body.newObject("PartDesign::Pocket","Pocket")
  798. App.activeDocument().Pocket.Profile = App.activeDocument().Sketch002
  799. App.activeDocument().Pocket.Length = 5.0
  800. Gui.activeDocument().hide("Sketch002")
  801. App.ActiveDocument.recompute()
  802. Gui.ActiveDocument.Pocket.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  803. Gui.ActiveDocument.Pocket.LineColor=Gui.ActiveDocument.Body.LineColor
  804. Gui.ActiveDocument.Pocket.PointColor=Gui.ActiveDocument.Body.PointColor
  805. Gui.ActiveDocument.Pocket.Transparency=Gui.ActiveDocument.Body.Transparency
  806. Gui.ActiveDocument.Pocket.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  807. Gui.activeDocument().setEdit('Pocket', 0)
  808. Gui.Selection.clearSelection()
  809. Gui.activeDocument().resetEdit()
  810. Gui.activateWorkbench('SketcherWorkbench')
  811. import PartDesignGui
  812. ActiveSketch = App.ActiveDocument.getObject('Sketch002')
  813. tv = Show.TempoVis(App.ActiveDocument)
  814. if ActiveSketch.ViewObject.HideDependent:
  815.   objs = tv.get_all_dependent(ActiveSketch)
  816.   objs = filter(lambda x: not x.TypeId.startswith("TechDraw::"), objs)
  817.   objs = filter(lambda x: not x.TypeId.startswith("Drawing::"), objs)
  818.   tv.hide(objs)
  819. if ActiveSketch.ViewObject.ShowSupport:
  820.   tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
  821. if ActiveSketch.ViewObject.ShowLinks:
  822.   tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
  823. tv.hide(ActiveSketch)
  824. ActiveSketch.ViewObject.TempoVis = tv
  825. del(tv)
  826.  
  827. ActiveSketch = App.ActiveDocument.getObject('Sketch002')
  828. if ActiveSketch.ViewObject.RestoreCamera:
  829.   ActiveSketch.ViewObject.TempoVis.saveCamera()
  830.  
  831. Gui.SendMsgToActiveView("ViewFit")
  832. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceX',8,2,-66.000000))
  833. App.ActiveDocument.Sketch002.addConstraint(Sketcher.Constraint('DistanceY',8,2,-9.171839))
  834. App.ActiveDocument.recompute()
  835. App.ActiveDocument.Sketch002.setDatum(40,App.Units.Quantity('4.200000 mm'))
  836. App.ActiveDocument.recompute()
  837. Gui.getDocument('Unnamed').resetEdit()
  838. ActiveSketch = App.ActiveDocument.getObject('Sketch002')
  839. tv = ActiveSketch.ViewObject.TempoVis
  840. if tv:
  841.   tv.restore()
  842. ActiveSketch.ViewObject.TempoVis = None
  843. del(tv)
  844.  
  845. Gui.activateWorkbench('PartDesignWorkbench')
  846. App.getDocument('Unnamed').recompute()
  847. App.activeDocument().Body.newObject("PartDesign::Pocket","Pocket")
  848. App.activeDocument().Pocket.Profile = App.activeDocument().Sketch002
  849. App.activeDocument().Pocket.Length = 5.0
  850. Gui.activeDocument().hide("Sketch002")
  851. App.ActiveDocument.recompute()
  852. Gui.ActiveDocument.Pocket.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  853. Gui.ActiveDocument.Pocket.LineColor=Gui.ActiveDocument.Body.LineColor
  854. Gui.ActiveDocument.Pocket.PointColor=Gui.ActiveDocument.Body.PointColor
  855. Gui.ActiveDocument.Pocket.Transparency=Gui.ActiveDocument.Body.Transparency
  856. Gui.ActiveDocument.Pocket.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  857. Gui.activeDocument().setEdit('Pocket', 0)
  858. Gui.Selection.clearSelection()
  859. Gui.activeDocument().hide("Sketch002")
  860. App.ActiveDocument.Pocket.Length = 6.000000
  861. App.ActiveDocument.Pocket.Length2 = 100.000000
  862. App.ActiveDocument.Pocket.Type = 0
  863. App.ActiveDocument.Pocket.UpToFace = None
  864. App.ActiveDocument.Pocket.Reversed = 0
  865. App.ActiveDocument.Pocket.Midplane = 0
  866. App.ActiveDocument.Pocket.Offset = 0.000000
  867. Gui.activeDocument().hide("Pad")
  868. App.ActiveDocument.recompute()
  869. Gui.activeDocument().resetEdit()
  870. App.activeDocument().Body.Tip = None
  871. App.ActiveDocument.recompute()
  872. Gui.activeDocument().activeView().viewRight()
  873. Gui.SendMsgToActiveView("ViewFit")
  874. App.activeDocument().Body.newObject("PartDesign::Fillet","Fillet")
  875. App.activeDocument().Fillet.Base = (App.ActiveDocument.Pocket,["Edge54","Edge53","Edge51","Edge50","Edge48","Edge47"])
  876. Gui.Selection.clearSelection()
  877. Gui.activeDocument().hide("Pocket")
  878. App.ActiveDocument.recompute()
  879. Gui.ActiveDocument.Fillet.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  880. Gui.ActiveDocument.Fillet.LineColor=Gui.ActiveDocument.Body.LineColor
  881. Gui.ActiveDocument.Fillet.PointColor=Gui.ActiveDocument.Body.PointColor
  882. Gui.ActiveDocument.Fillet.Transparency=Gui.ActiveDocument.Body.Transparency
  883. Gui.ActiveDocument.Fillet.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  884. Gui.activeDocument().setEdit('Fillet', 0)
  885. Gui.Selection.clearSelection()
  886. Gui.activeDocument().resetEdit()
  887. App.activeDocument().Body.newObject("PartDesign::Chamfer","Chamfer")
  888. App.activeDocument().Chamfer.Base = (App.ActiveDocument.Pocket,["Edge54","Edge53","Edge51","Edge50","Edge48","Edge47"])
  889. Gui.Selection.clearSelection()
  890. Gui.activeDocument().hide("Pocket")
  891. App.ActiveDocument.recompute()
  892. Gui.ActiveDocument.Chamfer.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  893. Gui.ActiveDocument.Chamfer.LineColor=Gui.ActiveDocument.Body.LineColor
  894. Gui.ActiveDocument.Chamfer.PointColor=Gui.ActiveDocument.Body.PointColor
  895. Gui.ActiveDocument.Chamfer.Transparency=Gui.ActiveDocument.Body.Transparency
  896. Gui.ActiveDocument.Chamfer.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  897. Gui.activeDocument().setEdit('Chamfer', 0)
  898. Gui.Selection.clearSelection()
  899. Gui.Selection.clearSelection()
  900. App.ActiveDocument.Chamfer.Size = 2.000000
  901. App.ActiveDocument.Chamfer.Base = (App.ActiveDocument.Pocket,["Edge54","Edge53","Edge51","Edge50","Edge48","Edge47",])
  902. Gui.activeDocument().hide("Pocket")
  903. App.ActiveDocument.recompute()
  904. App.ActiveDocument.Chamfer.Size = 1.000000
  905. App.ActiveDocument.Chamfer.Base = (App.ActiveDocument.Pocket,["Edge54","Edge53","Edge51","Edge50","Edge48","Edge47",])
  906. Gui.activeDocument().hide("Pocket")
  907. App.ActiveDocument.recompute()
  908. Gui.activeDocument().resetEdit()
  909. App.activeDocument().Body.newObject("PartDesign::Chamfer","Chamfer001")
  910. App.activeDocument().Chamfer001.Base = (App.ActiveDocument.Chamfer,["Edge33","Edge45"])
  911. Gui.Selection.clearSelection()
  912. Gui.activeDocument().hide("Chamfer")
  913. App.ActiveDocument.recompute()
  914. Gui.ActiveDocument.Chamfer001.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  915. Gui.ActiveDocument.Chamfer001.LineColor=Gui.ActiveDocument.Body.LineColor
  916. Gui.ActiveDocument.Chamfer001.PointColor=Gui.ActiveDocument.Body.PointColor
  917. Gui.ActiveDocument.Chamfer001.Transparency=Gui.ActiveDocument.Body.Transparency
  918. Gui.ActiveDocument.Chamfer001.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  919. Gui.activeDocument().setEdit('Chamfer001', 0)
  920. Gui.Selection.clearSelection()
  921. Gui.Selection.clearSelection()
  922. App.ActiveDocument.Chamfer001.Size = 1.000000
  923. App.ActiveDocument.Chamfer001.Base = (App.ActiveDocument.Chamfer,["Edge33","Edge45",])
  924. Gui.activeDocument().hide("Chamfer")
  925. App.ActiveDocument.recompute()
  926. Gui.activeDocument().resetEdit()
  927. App.activeDocument().Body.newObject("PartDesign::Fillet","Fillet")
  928. App.activeDocument().Fillet.Base = (App.ActiveDocument.Chamfer001,["Edge36"])
  929. Gui.Selection.clearSelection()
  930. Gui.activeDocument().hide("Chamfer001")
  931. App.ActiveDocument.recompute()
  932. Gui.ActiveDocument.Fillet.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  933. Gui.ActiveDocument.Fillet.LineColor=Gui.ActiveDocument.Body.LineColor
  934. Gui.ActiveDocument.Fillet.PointColor=Gui.ActiveDocument.Body.PointColor
  935. Gui.ActiveDocument.Fillet.Transparency=Gui.ActiveDocument.Body.Transparency
  936. Gui.ActiveDocument.Fillet.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  937. Gui.activeDocument().setEdit('Fillet', 0)
  938. Gui.Selection.clearSelection()
  939. App.ActiveDocument.Fillet.Radius = 1.000000
  940. App.ActiveDocument.Fillet.Base = (App.ActiveDocument.Chamfer001,["Edge36",])
  941. Gui.activeDocument().hide("Chamfer001")
  942. App.ActiveDocument.recompute()
  943. Gui.activeDocument().resetEdit()
  944. App.activeDocument().Body.newObject("PartDesign::Fillet","Fillet001")
  945. App.activeDocument().Fillet001.Base = (App.ActiveDocument.Fillet,["Edge57","Edge78","Edge79"])
  946. Gui.Selection.clearSelection()
  947. Gui.activeDocument().hide("Fillet")
  948. App.ActiveDocument.recompute()
  949. Gui.ActiveDocument.Fillet001.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  950. Gui.ActiveDocument.Fillet001.LineColor=Gui.ActiveDocument.Body.LineColor
  951. Gui.ActiveDocument.Fillet001.PointColor=Gui.ActiveDocument.Body.PointColor
  952. Gui.ActiveDocument.Fillet001.Transparency=Gui.ActiveDocument.Body.Transparency
  953. Gui.ActiveDocument.Fillet001.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  954. Gui.activeDocument().setEdit('Fillet001', 0)
  955. Gui.Selection.clearSelection()
  956. App.ActiveDocument.Fillet001.Radius = 1.000000
  957. App.ActiveDocument.Fillet001.Base = (App.ActiveDocument.Fillet,["Edge57","Edge78","Edge79",])
  958. Gui.activeDocument().hide("Fillet")
  959. App.ActiveDocument.recompute()
  960. Gui.activeDocument().resetEdit()
  961. App.activeDocument().Body.newObject("PartDesign::Fillet","Fillet002")
  962. App.activeDocument().Fillet002.Base = (App.ActiveDocument.Fillet001,["Edge87","Edge88"])
  963. Gui.Selection.clearSelection()
  964. Gui.activeDocument().hide("Fillet001")
  965. App.ActiveDocument.recompute()
  966. Gui.ActiveDocument.Fillet002.ShapeColor=Gui.ActiveDocument.Body.ShapeColor
  967. Gui.ActiveDocument.Fillet002.LineColor=Gui.ActiveDocument.Body.LineColor
  968. Gui.ActiveDocument.Fillet002.PointColor=Gui.ActiveDocument.Body.PointColor
  969. Gui.ActiveDocument.Fillet002.Transparency=Gui.ActiveDocument.Body.Transparency
  970. Gui.ActiveDocument.Fillet002.DisplayMode=Gui.ActiveDocument.Body.DisplayMode
  971. Gui.activeDocument().setEdit('Fillet002', 0)
  972. Gui.Selection.clearSelection()
  973. App.ActiveDocument.Fillet002.Radius = 2.000000
  974. App.ActiveDocument.Fillet002.Base = (App.ActiveDocument.Fillet001,["Edge87","Edge88",])
  975. Gui.activeDocument().hide("Fillet001")
  976. App.ActiveDocument.recompute()
  977. Gui.activeDocument().resetEdit()
  978. Gui.SendMsgToActiveView("ViewFit")
  979. Gui.activateWorkbench("DraftWorkbench")
  980. import PartDesignGui
  981. import Draft
  982. text = Draft.makeText(["King"],point=FreeCAD.Vector(-46.0,72.0,0.0))
  983. Draft.autogroup(text)
  984. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '1.2 mm'
  985. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '2.2 mm'
  986. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '3.2 mm'
  987. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '4.2 mm'
  988. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '5.2 mm'
  989. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '6.2 mm'
  990. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '7.2 mm'
  991. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '8.2 mm'
  992. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '9.2 mm'
  993. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '10.2 mm'
  994. FreeCADGui.getDocument("Unnamed").getObject("Text").FontSize = '11.2 mm'
  995. FreeCADGui.getDocument("Unnamed").getObject("Text").TextColor = (0.00,0.67,1.00)
  996. text = Draft.makeText(["MD Harrington"],point=FreeCAD.Vector(-61.0,19.999999999999996,0.0))
  997. Draft.autogroup(text)
  998. FreeCADGui.getDocument("Unnamed").getObject("Text001").FontSize = '1.2 mm'
  999. FreeCADGui.getDocument("Unnamed").getObject("Text001").FontSize = '2.2 mm'
  1000. FreeCADGui.getDocument("Unnamed").getObject("Text001").FontSize = '3.2 mm'
  1001. FreeCADGui.getDocument("Unnamed").getObject("Text001").FontSize = '4.2 mm'
  1002. FreeCADGui.getDocument("Unnamed").getObject("Text001").FontSize = '5.2 mm'
  1003. FreeCADGui.getDocument("Unnamed").getObject("Text001").FontSize = '6.2 mm'
  1004. FreeCADGui.getDocument("Unnamed").getObject("Text001").FontSize = '7.2 mm'
  1005. FreeCADGui.getDocument("Unnamed").getObject("Text001").FontSize = '8.2 mm'
  1006. FreeCADGui.getDocument("Unnamed").getObject("Text001").TextColor = (0.00,1.00,1.00)
  1007. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,1),App.Rotation(App.Vector(0,0,1),0))
  1008. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,2),App.Rotation(App.Vector(0,0,1),0))
  1009. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,3),App.Rotation(App.Vector(0,0,1),0))
  1010. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,4),App.Rotation(App.Vector(0,0,1),0))
  1011. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,5),App.Rotation(App.Vector(0,0,1),0))
  1012. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,6),App.Rotation(App.Vector(0,0,1),0))
  1013. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,7),App.Rotation(App.Vector(0,0,1),0))
  1014. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,8),App.Rotation(App.Vector(0,0,1),0))
  1015. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,9),App.Rotation(App.Vector(0,0,1),0))
  1016. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,10),App.Rotation(App.Vector(0,0,1),0))
  1017. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,11),App.Rotation(App.Vector(0,0,1),0))
  1018. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,12),App.Rotation(App.Vector(0,0,1),0))
  1019. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,13),App.Rotation(App.Vector(0,0,1),0))
  1020. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,14),App.Rotation(App.Vector(0,0,1),0))
  1021. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,15),App.Rotation(App.Vector(0,0,1),0))
  1022. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,16),App.Rotation(App.Vector(0,0,1),0))
  1023. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,17),App.Rotation(App.Vector(0,0,1),0))
  1024. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,18),App.Rotation(App.Vector(0,0,1),0))
  1025. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,19),App.Rotation(App.Vector(0,0,1),0))
  1026. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,20),App.Rotation(App.Vector(0,0,1),0))
  1027. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,21),App.Rotation(App.Vector(0,0,1),0))
  1028. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,22),App.Rotation(App.Vector(0,0,1),0))
  1029. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,23),App.Rotation(App.Vector(0,0,1),0))
  1030. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,24),App.Rotation(App.Vector(0,0,1),0))
  1031. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,25),App.Rotation(App.Vector(0,0,1),0))
  1032. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,26),App.Rotation(App.Vector(0,0,1),0))
  1033. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,27),App.Rotation(App.Vector(0,0,1),0))
  1034. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,28),App.Rotation(App.Vector(0,0,1),0))
  1035. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,29),App.Rotation(App.Vector(0,0,1),0))
  1036. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,30),App.Rotation(App.Vector(0,0,1),0))
  1037. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,31),App.Rotation(App.Vector(0,0,1),0))
  1038. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,32),App.Rotation(App.Vector(0,0,1),0))
  1039. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,33),App.Rotation(App.Vector(0,0,1),0))
  1040. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,34),App.Rotation(App.Vector(0,0,1),0))
  1041. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,35),App.Rotation(App.Vector(0,0,1),0))
  1042. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,36),App.Rotation(App.Vector(0,0,1),0))
  1043. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,37),App.Rotation(App.Vector(0,0,1),0))
  1044. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,38),App.Rotation(App.Vector(0,0,1),0))
  1045. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,39),App.Rotation(App.Vector(0,0,1),0))
  1046. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,40),App.Rotation(App.Vector(0,0,1),0))
  1047. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,41),App.Rotation(App.Vector(0,0,1),0))
  1048. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,42),App.Rotation(App.Vector(0,0,1),0))
  1049. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,43),App.Rotation(App.Vector(0,0,1),0))
  1050. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,44),App.Rotation(App.Vector(0,0,1),0))
  1051. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,45),App.Rotation(App.Vector(0,0,1),0))
  1052. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,46),App.Rotation(App.Vector(0,0,1),0))
  1053. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,47),App.Rotation(App.Vector(0,0,1),0))
  1054. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,48),App.Rotation(App.Vector(0,0,1),0))
  1055. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,49),App.Rotation(App.Vector(0,0,1),0))
  1056. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,50),App.Rotation(App.Vector(0,0,1),0))
  1057. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,51),App.Rotation(App.Vector(0,0,1),0))
  1058. FreeCAD.getDocument("Unnamed").getObject("Text001").Placement = App.Placement(App.Vector(-61,20,52),App.Rotation(App.Vector(0,0,1),0))
  1059. Gui.SendMsgToActiveView("ViewFit")
  1060. Gui.SendMsgToActiveView("Save")
  1061. App.getDocument("Unnamed").save()
  1062.  
  1063.  
  1064. Sod it Ill  sort that later  !!
  1065.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement