Advertisement
danfalck

multiDXFoutput.py

Dec 8th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import Part,Drawing,FreeCADGui,FreeCAD
  2. from FreeCAD import Vector
  3. filename = "/home/danfalck/Documents/freecad/testview2.dxf"#change the file name and directory here
  4. FILE = open(filename,"w")
  5.  
  6.  
  7. sel = FreeCADGui.Selection.getSelection()
  8. page = sel[0]
  9. views = page.OutList
  10.  
  11. fileout = "0\nSECTION\n2\nENTITIES\n"
  12.  
  13. for v in views:
  14.     fileout+= Drawing.projectToDXF(v.Source.Shape,v.Direction)
  15.  
  16. fileout+="0\nENDSEC\n0\nEOF\n"
  17. FILE.write(fileout)
  18. FILE.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement