Macro Repro Wire
File:Macro ReproWire Macro_ReproWire |
Description |
---|
Cette macro fait une copie de l'objet ou subObjet sélectionné. Auteur: Mario52 |
Auteur |
Mario52 |
Téléchargement |
None |
Liens |
Page des macros Comment installer une macro Comment créer une barre d'outils |
Version Macro |
1.0 |
Dernière modification |
None |
Version(s) FreeCAD |
None |
Raccourci clavier |
None |
Voir aussi |
None |
Description
Cette macro crée une copie de l'arête, face, objet ou sous objet sélectionné.
![Reproduction du fil objet ou face sélectionné](/images/thumb/1/11/Macro_ReproWire_00.png/480px-Macro_ReproWire_00.png)
Utilisation
Sélectionnez votre objet ou vos objets et démarrez la macro pour créer votre copie, les faces peuvent être extrudées .
The copies are coloured red and renamed with the Shapexxx + original names
Script
Macro_ReproWire.FCMacro the icon for the toolbar
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import Part,PartGui
__title__="Macro_ReproWire"
__author__ = "Mario52"
__url__ = "http://www.freecadweb.org/index-fr.html"
__version__ = "00.00"
__date__ = "22/10/2015"
sel = FreeCADGui.Selection.getSelection() # select one or many objects
try:
if len(sel) != 0:
numObj = -1
for i in range(len(FreeCADGui.Selection.getSelectionEx())): # boucle objects
for ii in range(len(FreeCADGui.Selection.getSelectionEx()[i].SubObjects)): # boucle SubObjects (sub objects selected)
numObj += 1 # numero of object
Part.show(FreeCADGui.Selection.getSelectionEx()[i].SubObjects[ii].copy()) # create repro shape
element_ = FreeCADGui.Selection.getSelectionEx()[i].SubElementNames[ii] # extract details to display
# Object /subObject / number objects total # details
print i+1 ,"/", ii+1 ,"/", len(sel) ," ", sel[numObj].Label ," ", element_ # display the info
a = App.ActiveDocument.ActiveObject
a.Label = a.Name+" "+sel[numObj].Label+" "+element_ # name 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 "Wrong selection"
Version
00.00 24/10/2015 :
Links
The forum are there any tools to extrude only selected surface from a sketch?