Macro Align Face Object to View: Difference between revisions
Renatorivo (talk | contribs) No edit summary |
(Vertical {{Macro}}; fixed icon) |
||
Line 2: | Line 2: | ||
<translate> |
<translate> |
||
<!--T:1--> |
<!--T:1--> |
||
{{Macro |
|||
⚫ | |||
|Name=Macro Align Face Object to View |
|||
⚫ | |||
|Author=Mario52 |
|||
|Version=0.1 |
|||
|Date=2015-01-16 |
|||
}} |
|||
==Description== <!--T:2--> |
==Description== <!--T:2--> |
Revision as of 18:23, 3 December 2018
Description |
---|
This macro directs the face of the object on the side of the ActiveView. Macro version: 0.1 Last modified: 2015-01-16 Author: Mario52 |
Author |
Mario52 |
Download |
None |
Links |
Macros recipes How to install macros How to customize toolbars |
Macro Version |
0.1 |
Date last modified |
2015-01-16 |
FreeCAD Version(s) |
None |
Default shortcut |
None |
See also |
None |
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
How to use
- 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
# 16/01/2015
__title__="FCCamera"
__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