Macro Align Object to View/fr: Difference between revisions
(Updating to match new version of source page) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Macro/fr|Icon=Text-x-python|Name=Macro Align Object to View|Name/fr=Macro Align Object to View|Description= |
{{Macro/fr|Icon=Text-x-python|Name=Macro Align Object to View|Name/fr=Macro Align Object to View|Description=Cette macro aligne l'objet sélectonné sur la vue 3D.|See= tyt |Author=Mario52}} |
||
==Description== |
==Description== |
Revision as of 18:46, 5 September 2016
File:Text-x-python Macro Align Object to View |
Description |
---|
Cette macro aligne l'objet sélectonné sur la vue 3D. 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
This macro aligns and Position the selected object to the current View.
How to use
- Direct your view, select your object and run the macro
- Your object will be the placement of the camera coordinates
Script
Macro Align Object to View.FCMacro
# This macro place your object selected to the position ActiveView (camera)
# extact
# 16/01/2015
__title__="FCCamera"
__author__ = "Mario52"
import pivy
from pivy import coin
sel = FreeCADGui.Selection.getSelection()
Nameelement = sel[0].Name
App.Console.PrintMessage(str(Nameelement)+"\n")
pl = FreeCAD.Placement()
pl.Rotation = FreeCADGui.ActiveDocument.ActiveView.getCameraOrientation()
pl.Base = FreeCAD.Vector(0.0,0.0,0.0)
App.ActiveDocument.getObject(Nameelement).Placement=pl
Exemple
-
Your object in its original position XY.
-
Rotate the screen X? Y? Z? or use this macro Macro_Rotate_View for precise rotation.
-
Select the object and run the macro (the object face the screen).
-
Your object return in the XY display and in its new coordinates position (Placement,Angle)
Credits
Tanks Simplified code to rentlau_64