Advertisement
danfalck

viseMove.py

Jun 2nd, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. import Draft
  2. from FreeCAD import Vector
  3.  
  4. '''
  5. moves object upper left hand corner to origin
  6. with top surface of part at z=0
  7. '''
  8.  
  9. sel=Gui.Selection.getSelection()
  10.  
  11. Xmin = sel[0].Shape.BoundBox.XMin
  12. Ymax = sel[0].Shape.BoundBox.YMax
  13. Zmax = sel[0].Shape.BoundBox.ZMax
  14.  
  15. xmove = 0 - Xmin
  16. ymove = 0 - Ymax
  17. zmove = 0 - Zmax
  18.  
  19. Draft.move(sel,Vector(xmove,ymove,zmove))
  20. App.activeDocument().recompute()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement