Macro Align Object to View/fr: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<div class="mw-translate-fuzzy">
{{Macro/fr
{{Macro/fr
|Name=Macro Align Object to View
|Name=Macro Align Object to View
|Icon=Macro_Align_Object_to_View.png
|Name/fr=Macro Align Object to View
|Translate=Macro Align Object to View
|Description=Cette macro aligne l'objet sélectionné sur la vue 3D.
|Description=Cette macro aligne l'objet sélectionné sur la vue 3D.
|Author=Mario52
|Author=Mario52
|Version=0.1
|Version=0.1
|Date=2015-01-16
|Date=2015-01-16
|FCVersion=All
|Download=[https://www.freecadweb.org/wiki/images/f/f4/Macro_Align_Object_to_View.png ToolBar Icon]
|SeeAlso=[[File:FCCamera 00.png|32px|FCCamera]] [[Macro_FCCamera/fr|Macro_FCCamera]]
|SeeAlso=[[File:FCCamera 00.png|32px|FCCamera]] [[Macro_FCCamera/fr|Macro_FCCamera]]
}}
}}
</div>


==Description==
==Description==
Cette macro aligne l'objet sélectionné sur la vue 3D.
Cette macro aligne l'objet sélectionné sur la vue 3D.


==Utilisation==
==Comment l'utiliser==
* Dirigez votre vue, sélectionnez votre objet et lancez la macro
* Dirigez votre vue, sélectionnez votre objet et lancez la macro
* Votre objet est dirigé sur la position de la caméra
* Votre objet est dirigé sur la position de la caméra


==Script==
==Script==
ToolBar Icon [[Image:Macro_Align_Object_to_View.png]]

'''Macro_Align_Object_to_View.FCMacro'''
'''Macro_Align_Object_to_View.FCMacro'''


{{Code|code=
{{MacroCode|code=
# This macro place your object selected to the position ActiveView (camera)
# This macro place your object selected to the position ActiveView (camera)
# extact FCCamera
# extact FCCamera
Line 46: Line 49:


}}
}}

==Exemple==
==Exemple==



Latest revision as of 12:42, 23 May 2020

Other languages:

Macro Align Object to View

Description
Cette macro aligne l'objet sélectionné sur la vue 3D.

Version macro : 0.1
Date dernière modification : 2015-01-16
Version FreeCAD : All
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
All
Raccourci clavier
None
Voir aussi
FCCamera Macro_FCCamera

Description

Cette macro aligne l'objet sélectionné sur la vue 3D.

Utilisation

  • Dirigez votre vue, sélectionnez votre objet et lancez la macro
  • Votre objet est dirigé sur la position de la caméra

Script

ToolBar Icon

Macro_Align_Object_to_View.FCMacro

# This macro place your object selected to the position ActiveView (camera)
# extact FCCamera
# 16/01/2015

__title__  ="Align Object to View"
__author__ = "Mario52"
__date__   = "16/01/2015"
__version__= "0.1"

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

Credits

Merci rentlau_64 pour avoir simplifié le code