Macro Rotate View: Difference between revisions

From FreeCAD Documentation
m (icon)
m (Refinements to the wiki page only (not to macro))
Line 5: Line 5:
|Name=Rotate View by 90°
|Name=Rotate View by 90°
|Icon=Macro Rotate View view 90 Degrees.png
|Icon=Macro Rotate View view 90 Degrees.png
|Description=This macro rotates the current view by 90° to the left. Only works if you are in Top view
|Description=This macro rotates the current view by 90° to the left. Only works if you are in [[Std_ViewTop|Top view]].
|Author=Yorik
|Author=Yorik
|Version=01.00
|Version=01.00
Line 17: Line 17:


<!--T:9-->
<!--T:9-->
This macro rotates the current view by 90° to the left. Only works if you are in Top view [[File:Macro_Rotate_View_view_90_Degrees.png|rotation 90 degrees]]
This macro rotates the current view by 90° to the left.

==Limitations==

Only works if you are in Top view: {{Button|[[Image:View-top.svg|Std_ViewTop|16px|link=Std_ViewTop]] XY (top)}}


==Script== <!--T:10-->
==Script== <!--T:10-->

Revision as of 14:23, 14 March 2020

Rotate View by 90°

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

Macro version: 01.00
Last modified: 2010-11-17
FreeCAD version: All
Download: Macro_Rotate_View_view_90_Degrees
Author: Yorik
Author
Yorik
Download
Macro_Rotate_View_view_90_Degrees
Links
Macro Version
01.00
Date last modified
2010-11-17
FreeCAD Version(s)
All
Default shortcut
None
See also
Macro_Rotate_ViewAxonometric
Macro Rotate View Free

Description

This macro rotates the current view by 90° to the left.

Limitations

Only works if you are in Top view: Std_ViewTop XY (top)

Script

ToolBar Icon

Macro_Rotate_View_90_Degrees.FCMacro

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