Macro SuperWire: Difference between revisions

From FreeCAD Documentation
(Created page with '{{Macro|Name=SuperWire|Description=This macro creates a wire from selected objects (lines and arcs) even where normal wire creation methods (for example the upgrade tool) fail|Au…')
 
mNo edit summary
Line 5: Line 5:
import FreeCAD,FreeCADGui,Part
import FreeCAD,FreeCADGui,Part
from draftlibs import fcgeo
from draftlibs import fcgeo

sel = FreeCADGui.Selection.getSelection()
sel = FreeCADGui.Selection.getSelection()
if not sel:
if not sel:

Revision as of 22:23, 23 September 2011

Generic macro icon. Create your personal icon with the same name of the macro SuperWire

Description
This macro creates a wire from selected objects (lines and arcs) even where normal wire creation methods (for example the upgrade tool) fail

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

Attention, you need a recent version of FreeCAD for this to work

import FreeCAD,FreeCADGui,Part
from draftlibs import fcgeo

sel = FreeCADGui.Selection.getSelection()
if not sel:
   FreeCAD.Console.PrintWarning("Select something first!")
else:
   elist = []
   for obj in sel:
       if hasattr(obj,"Shape"):
           elist.append(obj.Shape.Edges[0])
   wire = fcgeo.superWire(elist)
   if wire:
       Part.show(wire)
   else:
       FreeCAD.Console.PrintError("SuperWire operation failed!")