Macro Rotate View

From FreeCAD Documentation
Revision as of 01:43, 17 November 2010 by Yorik (talk | contribs) (Created page with '{{Macro|Name=Rotate View by 90°|Description=This macro rotates the current view by 90° to the left. Only works if you are in Top view|Author=Yorik}} import math from pivy im…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Generic macro icon. Create your personal icon with the same name of the macro Rotate View by 90°

Description
This macro rotates the current view by 90° to the left. Only works if you are in Top view

Author: Yorik
Author
Yorik
Download
None
Links
Macro Version
1.0
Date last modified
None
FreeCAD Version(s)
None
Default shortcut
None
See also
None

import math
from pivy import coin
cam = Gui.ActiveDocument.ActiveView.getCameraNode()
rot = coin.SbRotation()
rot.setValue(coin.SbVec3f(0,0,1),math.pi/2)
nrot = cam.orientation.getValue() * rot
cam.orientation = nrot