<html><head><title>Macro ReproWire/it</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type='text/css' href='wiki.css' rel='stylesheet'></head><body><h1>Macro ReproWire/it</h1><span class="mw-redirectedfrom">(Redirected from <a href="https://www.freecadweb.org/wiki/index.php?title=Macro_ReproWire/it&redirect=no" class="mw-redirect" title="Macro ReproWire/it">Macro ReproWire/it</a>)</span></div> <div id="mw-content-text" lang="it" dir="ltr" class="mw-content-ltr"><hr/><div class="mw-parser-output"><table class="fcinfobox wikitable ct" width="100%" style="float: right; width: 230px; margin-left: 10px;"> <tr> <td class="ctTitle"> <h3><span class="mw-headline" id="Replica_un_componente"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_ReproWire.png" class="image"><img alt="Macro ReproWire.png" src="32px-Macro_ReproWire.png" width="32" height="32" srcset="/wiki/images/thumb/a/a3/Macro_ReproWire.png/48px-Macro_ReproWire.png 1.5x, Macro_ReproWire.png 2x" /></a> Replica un componente</span></h3> </td></tr> <tr> <th class="ctOdd">Descrizione </th></tr> <tr> <td class="ctEven left">Questa macro crea un duplicato di un sottoelemento subObject ... selezionato. </td></tr> <tr> <th class="ctOdd">Autore </th></tr> <tr> <td class="ctEven"><a href="https://www.freecadweb.org/wiki/index.php?title=User:Mario52" title="User:Mario52">Mario52</a> </td></tr> <tr> <th class="ctOdd">Link </th></tr> <tr> <td class="ctEven"><a href="https://www.freecadweb.org/wiki/index.php?title=Macros_recipes/it" title="Macros recipes/it">Esempi di macro</a><br /><a href="https://www.freecadweb.org/wiki/index.php?title=How_to_install_macros/it" title="How to install macros/it">Come installare le Macro</a><br /><a href="https://www.freecadweb.org/wiki/index.php?title=Customize_Toolbars/it" title="Customize Toolbars/it">Personalizzare la barra degli strumenti</a> </td></tr> <tr> <th class="ctOdd">Versione </th></tr> <tr> <td class="ctEven macro-version">00.01 </td></tr> <tr> <th class="ctOdd">Data ultima modifica </th></tr> <tr> <td class="ctEven macro-date">2015-10-24 </td></tr> <tr> <th class="ctOdd"> </th></tr> <tr> <td class="ctToc"><br /><div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div> <ul> <li class="toclevel-1"><a href="#Replica_un_componente"><span class="tocnumber">1</span> <span class="toctext">Replica un componente</span></a></li> <li class="toclevel-1 tocsection-1"><a href="#Descrizione"><span class="tocnumber">2</span> <span class="toctext">Descrizione</span></a></li> <li class="toclevel-1 tocsection-2"><a href="#Uso"><span class="tocnumber">3</span> <span class="toctext">Uso</span></a></li> <li class="toclevel-1 tocsection-3"><a href="#Script"><span class="tocnumber">4</span> <span class="toctext">Script</span></a></li> <li class="toclevel-1 tocsection-4"><a href="#Versione"><span class="tocnumber">5</span> <span class="toctext">Versione</span></a></li> <li class="toclevel-1 tocsection-5"><a href="#Link"><span class="tocnumber">6</span> <span class="toctext">Link</span></a></li> </ul> </div> </td></tr> </table> <p><br /> </p> <h2><span class="mw-headline" id="Descrizione">Descrizione</span></h2> <p>Questa macro crea un duplicato di un oggetto, subObject, faccia, contorno o linea, selezionato. </p> <div class="floatleft"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_ReproWire_00.png" class="image" title="ReproWire"><img alt="ReproWire" src="480px-Macro_ReproWire_00.png" width="480" height="360" srcset="/wiki/images/1/11/Macro_ReproWire_00.png 1.5x" /></a></div> <div style="clear:both"></div> <p><br /> </p> <h2><span class="mw-headline" id="Uso">Uso</span></h2> <p>Selezionare l'oggetto e poi eseguire la macro per creare la sua copia. È possibile usare la copia per produrre delle estrusioni o altre ordinarie operazioni. </p><p>Le copie sono di colore rosso e denominate "Shapexxx + il nome dell'originale". </p> <h2><span class="mw-headline" id="Script">Script</span></h2> <p><b> Macro_ReproWire.FCMacro</b> l'icona per la barra degli strumenti <a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_ReproWire.png" class="image" title="icon for the button"><img alt="icon for the button" src="Macro_ReproWire.png" width="64" height="64" /></a> </p> <pre># -*- coding: utf-8 -*- from __future__ import unicode_literals import codecs #https://docs.python.org/2/howto/unicode.html import Part,Draft # #__title__="Macro_ReproWire" #__author__ = "Mario52" #__url__ = "http://www.freecadweb.org/index-fr.html" #__version__ = "00.01" #__date__ = "24/10/2015" # sel = Gui.Selection.getSelection() s = Gui.Selection.getSelectionEx() try: if len(sel) != 0: print "Object(s) : ", len(sel), " , SubObject(s) : ", len(s) i2 = ii2 = -1 for i in s: i2 += 1 ii2 = -1 try: FreeCADGui.Selection.getSelectionEx()[i2].SubObjects[ii2] for ii in i.SubElementNames: # print "SubObject" ii2 += 1 Part.show(FreeCADGui.Selection.getSelectionEx()[i2].SubObjects[ii2].copy()) # create repro shape subObject print i2+1 ,"/", ii2+1 ,"/", len(s) ," ", i.ObjectName ," ", ii # display the info SubObject a = App.ActiveDocument.ActiveObject # object Name / original object Name / SubObject Name a.Label = a.Name + " " + i.ObjectName + " " + ii # Label for the repro shape try: FreeCADGui.activeDocument().activeObject().LineColor = (1.0,0.0,0.0) # give LineColor FreeCADGui.activeDocument().activeObject().PointColor = (1.0,0.0,0.0) # give PointColor FreeCADGui.activeDocument().activeObject().ShapeColor = (1.0,0.0,0.0) # give ShapeColor except Exception: None except Exception: # print "Not SubObject" Part.show(sel[i2].Shape) # create repro shape object print i2+1 ,"/", ii2+1 ,"/", len(s) ," ", sel[i2].Name # display the info SubObject a = App.ActiveDocument.ActiveObject # object Name / original object Name a.Label =a.Name + " " + sel[i2].Name # Label for the repro shape try: FreeCADGui.activeDocument().activeObject().LineColor = (1.0,0.0,0.0) # give LineColor FreeCADGui.activeDocument().activeObject().PointColor = (1.0,0.0,0.0) # give PointColor FreeCADGui.activeDocument().activeObject().ShapeColor = (1.0,0.0,0.0) # give ShapeColor except Exception: None else : print "Select one object" except Exception: print "Unexpected error" </pre> <h2><span class="mw-headline" id="Versione">Versione</span></h2> <p>00.01 24/10/2015 : </p><p>00.00 22/10/2015 : </p> <h2><span class="mw-headline" id="Link">Link</span></h2> <p>Nel forum <a rel="nofollow" class="external text" href="http://forum.freecadweb.org/viewtopic.php?f=3&t=12922">are there any tools to extrude only selected surface from a sketch?</a> </p><p><br /> </p> <div style="clear:both"></div> </div> </div> </div><div class="printfooter"> Online version: "<a dir="ltr" href="https://www.freecadweb.org/wiki/index.php?title=Macro_Repro_Wire/it&oldid=240721">http://www.freecadweb.org/wiki/index.php?title=Macro_Repro_Wire/it&oldid=240721</a>"</div> <div id="catlinks" class="catlinks" data-mw="interface"></div><div class="visualClear"></div> </div> </div> <div id="mw-navigation"> <h2>Navigation menu</h2> </body></html>