Macro HealArcs

From FreeCAD Documentation
Revision as of 18:18, 24 December 2013 by FuzzyBot (talk | contribs) (Updating to match new version of source page)

File:Text-x-python HealArcs

Description
Sometimes arcs are transformed into BSplines, for example when scale operations have been applied to them. This macro recreates valid arcs from them. Useful before exporting to dxf

Author: Yorik
Author
Yorik
Download
None
Links
Macro Version
1.0
Date last modified
None
FreeCAD Version(s)
None
Default shortcut
None
See also
None

Sometimes arcs are transformed into BSplines, for example when scale operations have been applied to them. This macro recreates valid arcs from them. Useful before exporting to dxf


 try:
     import DraftGeomUtils as fcgeo
 except:
     from draftlibs import fcgeo
 import FreeCAD,FreeCADGui,Part
 
 sel = FreeCADGui.Selection.getSelection()
 if not sel:
     FreeCAD.Console.PrintWarning("Select something first!")
 else:
     removeList = []
     for obj in sel:
         ed = obj.Shape.Edges[0]
         arc = fcgeo.arcFromSpline(ed)
         if arc:
             Part.show(arc)
             removeList.append(obj.Name)
     FreeCAD.ActiveDocument.recompute()
     print "removing ",removeList
     for n in removeList:
         FreeCAD.ActiveDocument.removeObject(n)
Other languages: