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

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 36: Line 36:
'''Macro_Align_Face_Object_to_View.FCMacro'''
'''Macro_Align_Face_Object_to_View.FCMacro'''


{{MacroCode|code=
{{Code|code=
# This macro directs the face of the object on the side of the ActiveView (camera)
# This macro directs the face of the object on the side of the ActiveView (camera)
# extact FCCamera
# extact FCCamera

Revision as of 16:53, 14 September 2021

Other languages:

Macro Align Face Object to View

Description
Cette macro dirige la face de l'objet sur la face de la vue active.

Version macro : 0.1
Date dernière modification : 2015-01-16
Version FreeCAD : Toutes
Téléchargement : ToolBar Icon
Auteur: Mario52
Auteur
Mario52
Téléchargement
ToolBar Icon
Liens
Version Macro
0.1
Dernière modification
2015-01-16
Version(s) FreeCAD
Toutes
Raccourci clavier
None
Voir aussi
FCCamera Macro_FCCamera

Description

Description

Cette macro dirige la face de l'objet sur la face de la vue active (caméra). Dans le cas de la face d'un perçage (ou interne ou cylindre), face à l'écran.

Usage

Utilisation

  • Sélectionnez une face de votre objet et lancez la macro
  • Votre sélection fait face à l'écran

Script

ToolBar Icon

Macro_Align_Face_Object_to_View.FCMacro

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

__title__="Macro_Align_Face_Object_to_View"
__author__ = "Mario52"

import pivy
from pivy import coin

try:
    v=Gui.Selection.getSelectionEx()[0].SubObjects[0].Surface.Axis    # to Axis
#    v = Gui.Selection.getSelectionEx()[0].SubObjects[0].normalAt(0,0) # normalAt
    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")

Links

Original macro by wmayer Looking for some helpful GUI-commands