Macro Align Face Object to View: Difference between revisions
m (Icon) |
(Use {{MacroCode}}) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
{{Macro |
{{Macro |
||
|Name=Macro Align Face Object to View |
|Name=Macro Align Face Object to View |
||
|Icon=Macro_Align_Face_Object_to_View.png |
|||
|Description=This macro directs the face of the object on the side of the ActiveView. |
|Description=This macro directs the face of the object on the side of the ActiveView. |
||
|Author=Mario52 |
|Author=Mario52 |
||
Line 17: | Line 18: | ||
In the case of the face of a borehole (or internal or cylinder) face drilling facing the screen |
In the case of the face of a borehole (or internal or cylinder) face drilling facing the screen |
||
== |
==Usage== <!--T:3--> |
||
* Select your object and run the macro |
* Select your object and run the macro |
||
* Your object will be of the camera |
* Your object will be of the camera |
||
Line 27: | Line 28: | ||
'''Macro_Align_Face_Object_to_View.FCMacro''' |
'''Macro_Align_Face_Object_to_View.FCMacro''' |
||
{{ |
{{MacroCode|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 22:56, 7 May 2020
Description |
---|
This macro directs the face of the object on the side of the ActiveView. 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 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
Usage
- 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 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