Macro Make Arc 3 Points/it: Difference between revisions

From FreeCAD Documentation
(Created page with "{{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}}")
(Created page with "==Descrizione== Questa macro crea un arco da 3 punti selezionati")
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}}
==Description==
==Descrizione==
This macro creates a arc on 3 selected points.
Questa macro crea un arco da 3 punti selezionati
==Use==
==Use==
Select 3 points, or 3 points subObject and run the macro.
Select 3 points, or 3 points subObject and run the macro.

Revision as of 19:56, 29 June 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
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

Select 3 points, or 3 points subObject and run the macro.

Script

The icon for the toolBar

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.00"
__date__    = "28/06/2019"


selectedObject = FreeCADGui.Selection.getSelection()    # select one element
selectedEdge = FreeCADGui.Selection.getSelectionEx()    # select one subElement

try:
    try:
        point0 = selectedObject[0].Shape.Point          # element
        point1 = selectedObject[1].Shape.Point
        point2 = selectedObject[2].Shape.Point
    except:
        point0 = selectedEdge[0].SubObjects[0].Point    # subElement
        point1 = selectedEdge[0].SubObjects[1].Point
        point2 = selectedEdge[0].SubObjects[2].Point

    FreeCAD.Console.PrintMessage(str(point0)+" "+str(point1)+" "+str(point2))

    C1 = Part.Arc(point0,point1,point2)
    S1 = Part.Shape([C1])
    W = Part.Wire(S1.Edges)
    Part.show(W)
except:
    FreeCAD.Console.PrintError("Select tree points or tree subObjects points"+"\n")
Other languages: