Macro SuperWire: Difference between revisions
Renatorivo (talk | contribs) (Marked this version for translation) |
(delete spaces) |
||
Line 9: | Line 9: | ||
</translate> |
</translate> |
||
{{Code|code= |
|||
<syntaxhighlight> |
|||
import FreeCAD,FreeCADGui,Part |
|||
try: |
|||
import DraftGeomUtils as fcgeo |
|||
except: |
|||
from draftlibs import fcgeo |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</syntaxhighlight> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
}} |
|||
{{clear}} |
{{clear}} |
||
<languages/> |
<languages/> |
Revision as of 20:34, 26 December 2014
File:Text-x-python 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 |
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 |
This macro creates a wire from selected objects (lines and arcs) even where normal wire creation methods (for example the upgrade tool) fail.
Attention, you need a recent version of FreeCAD for this to work
import FreeCAD,FreeCADGui,Part
try:
import DraftGeomUtils as fcgeo
except:
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!")