Macro Make Arc 3 Points/it: Difference between revisions
(Updating to match new version of source page) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Macro/it|Icon=Macro_Make_Arc_3_Points|Name=Macro Make Arc 3 Points|Name/it=Macro Arco da 3 punti|Description=Crea un arco da 3 punti selezionati.|Author=Mario52}} |
{{Macro/it|Icon=Macro_Make_Arc_3_Points|Name=Macro Make Arc 3 Points|Name/it=Macro Arco da 3 punti|Description=Crea un arco da 3 punti selezionati.|Author=Mario52}} |
||
== |
==Descrizione== |
||
Questa macro crea un arco da 3 punti selezionati |
|||
== |
==Use== |
||
Launch the macro, select 3 points, the arc is created and the coordinates and the length of the arc are displayed in the report view. |
|||
Selezionare 3 punti, o 3 punti di sub-oggetti ed eseguire la macro. |
|||
(PS: It is not required to hold down the Ctrl key) |
(PS: It is not required to hold down the Ctrl key) |
Revision as of 10:23, 14 July 2016
File:Macro Make Arc 3 Points Macro Make Arc 3 Points |
Descrizione |
---|
Crea un arco da 3 punti selezionati. Autore: Mario52 |
Autore |
Mario52 |
Download |
None |
Link |
Raccolta di macro Come installare le macro Personalizzare la toolbar |
Versione macro |
1.0 |
Data ultima modifica |
None |
Versioni di FreeCAD |
None |
Scorciatoia |
Nessuna |
Vedere anche |
Nessuno |
Descrizione
Questa macro crea un arco da 3 punti selezionati
Use
Launch the macro, select 3 points, the arc is created and the coordinates and the length of the arc are displayed in the report view.
(PS: It is not required to hold down the Ctrl key)
Script
L'icona per la barra degli strumenti:
Macro_Make_Arc_3_Points.FCMacro
# -*- coding: utf-8 -*-
from FreeCAD import Base
__title__ = "Macro_Make_Arc_3_points"
__author__ = "Mario52"
__url__ = "http://www.freecadweb.org/index-fr.html"
__version__ = "00.01"
__date__ = "14/07/2016"
global selected; selected = []
App = FreeCAD
class SelObserver:
print "Create Arc to 3 points ..."
def addSelection(self,doc,obj,sub,pnt): # Selection
global selected
selected.append(pnt)
if len(selected) == 1:
print "Point 1 : ",FreeCAD.Vector(selected[0])
elif len(selected) == 2:
print "Point 2 : ",FreeCAD.Vector(selected[1])
elif len(selected) == 3:
print "Point 3 : ",FreeCAD.Vector(selected[2])
try:
C1 = Part.Arc(FreeCAD.Vector(selected[0]),FreeCAD.Vector(selected[1]),FreeCAD.Vector(selected[2]))
S1 = Part.Shape([C1])
W = Part.Wire(S1.Edges)
Part.show(W)
App.ActiveDocument.ActiveObject.Label = "Arc_3_Points"
print "Length : ",W.Length
except Exception:
print "Three points are collinear or bad selection"
del selected[:]
FreeCADGui.Selection.removeObserver(s)
print "End Make_Arc_3_Points"
print "_____________________"
s=SelObserver()
FreeCADGui.Selection.addObserver(s)