Macro Align Object to View/ru: Difference between revisions
(Created page with "==Пример==") |
(Created page with "==Авторы== rentlau_64 провел упрощение кода.") |
||
Line 65: | Line 65: | ||
</center> |
</center> |
||
== |
==Авторы== |
||
rentlau_64 провел упрощение кода. |
|||
Tanks Simplified code to rentlau_64 |
|||
{{clear}} |
{{clear}} |
Latest revision as of 22:34, 5 August 2021
Description |
---|
This macro aligns the selected object to the current View. Macro version: 0.1 Last modified: 2015-01-16 FreeCAD version: All Download: ToolBar Icon Author: Mario52 |
Author |
Mario52 |
Download |
ToolBar Icon |
Links |
Macros recipes How to install macros How to customize toolbars |
Macro Version |
0.1 |
Date last modified |
2015-01-16 |
FreeCAD Version(s) |
All |
Default shortcut |
None |
See also |
Macro_FCCamera |
Description
This macro aligns and Position the selected object to the current View.
Usage
- Direct your view, select your object and run the macro
- Your object will be the placement of the camera coordinates
Скрипт
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
Пример
-
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)
Авторы
rentlau_64 провел упрощение кода.