Macro Forza Wire

From FreeCAD Documentation
Revision as of 20:11, 1 January 2014 by Renatorivo (talk | contribs) (Created page with "{{Macro/it|Icon=Text-x-python|Name=SuperWire|Name/it=SuperWire|Description=Questa macro crea una polilinea da oggetti selezionati (linee e archi), anche quando i normali metod...")

File:Text-x-python SuperWire

Descrizione
Questa macro crea una polilinea da oggetti selezionati (linee e archi), anche quando i normali metodi di creazione delle polilinee, per esempio lo strumento di aggiornamento, non funzionano

Autore: Yorik
Autore
Yorik
Download
None
Link
Versione macro
1.0
Data ultima modifica
None
Versioni di FreeCAD
None
Scorciatoia
Nessuna
Vedere anche
Nessuno

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!")