Macro HealArcs
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 |
Macros recipes How to install macros How to customize toolbars |
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)