Macro Align Face Object to View/it: Difference between revisions

From FreeCAD Documentation
(Created page with "Macro Align Face Object to View")
 
(Created page with "{{Macro/it|Icon=Text-x-python|Name=Macro Align Face Object to View|Name/it=Align Face Object to View|Description=Questa macro dirige la faccia dell'oggetto sul lato del Active...")
Line 1: Line 1:
{{Macro|Icon=Text-x-python|Name=Macro Align Face Object to View|Description=This macro directs the face of the object on the side of the ActiveView.|Author=Mario52}}
{{Macro/it|Icon=Text-x-python|Name=Macro Align Face Object to View|Name/it=Align Face Object to View|Description=Questa macro dirige la faccia dell'oggetto sul lato del ActiveView.|Author=Mario52}}


==Description==
==Description==

Revision as of 22:20, 16 January 2015

File:Text-x-python Macro Align Face Object to View

Descrizione
Questa macro dirige la faccia dell'oggetto sul lato del ActiveView.

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

Description

This macro directs the face of the object on the side of the ActiveView (camera). In the case of the face of a borehole (or internal or cylinder) face drilling facing the screen

How to use

  • Select your object and run the macro
  • Your object will be of the camera

Script

Macro_Align_Face_Object_to_View.FCMacro

# This macro directs the face of the object on the side of the ActiveView (camera)
# extact
# 16/01/2015

__title__="FCCamera"
__author__ = "Mario52"

import pivy
from pivy import coin

try:
    v=Gui.Selection.getSelectionEx()[0].SubObjects[0].Surface.Axis
    dir = Gui.Selection.getSelectionEx()[0].SubObjects[0].normalAt(0,0)
    r=App.Rotation(App.Vector(0,0,1),v)
    Gui.ActiveDocument.ActiveView.setCameraOrientation(r.Q)
except Exception:
    App.Console.PrintError("Select a face and run the macro"+"\n")


Other languages: