Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Part,Drawing,FreeCADGui,FreeCAD
- from FreeCAD import Vector
- filename = "/home/danfalck/Documents/freecad/testview2.dxf"#change the file name and directory here
- FILE = open(filename,"w")
- sel = FreeCADGui.Selection.getSelection()
- page = sel[0]
- views = page.OutList
- fileout = "0\nSECTION\n2\nENTITIES\n"
- for v in views:
- fileout+= Drawing.projectToDXF(v.Source.Shape,v.Direction)
- fileout+="0\nENDSEC\n0\nEOF\n"
- FILE.write(fileout)
- FILE.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement