Advertisement
danfalck

point_coords.py

May 16th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. #select some Draft Points-non Draft Vertexes won't work with this particular method:
  2. selection = Gui.Selection.getSelection()
  3.  
  4. for p in selection:
  5.     print p.X,",",p.Y,",",p.Z
  6.  
  7.  
  8. #for non Draft workbench points (ie Vertexes selected at line end points), that you pick on the screen:
  9. selection = Gui.Selection.getSelectionEx()[0].SubObjects
  10. for v in selection:
  11.     print v.X,",",v.Y,",",v.Z
  12.  
  13. #for end points of Draft rectangle for an example:
  14.  
  15. rect = Gui.Selection.getSelection()[0]
  16. for e in rect.Shape.Edges:
  17.     print e.Vertexes[0].X,",",e.Vertexes[0].Y,",",e.Vertexes[0].Z
  18.     print e.Vertexes[-1].X,",",e.Vertexes[-1].Y,",",e.Vertexes[-1].Z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement