Macro Rotate View: Difference between revisions
m (icon) |
No edit summary |
||
(10 intermediate revisions by 4 users not shown) | |||
Line 3: | Line 3: | ||
<!--T:1--> |
<!--T:1--> |
||
{{Macro |
{{Macro |
||
|Name=Rotate View by 90° |
|Name=Macro 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 |
||
|Date=2010-11-17 |
|Date=2010-11-17 |
||
|FCVersion=All |
|FCVersion=All |
||
|Download=[https:// |
|Download=[https://wiki.freecad.org/images/a/a0/Macro_Rotate_View_view_90_Degrees.png ToolBar Icon] |
||
|SeeAlso=[[Macro_Rotate_ViewAxonometric| |
|SeeAlso=[[Macro_Rotate_ViewAxonometric|Macro Rotate ViewAxonometric]], [[Macro_Rotate_View_Free|Macro Rotate View Free]] |
||
}} |
}} |
||
Line 17: | Line 17: | ||
<!--T:9--> |
<!--T:9--> |
||
This macro rotates the current view by 90° to the left. |
This macro rotates the current view by 90° to the left. |
||
==Limitations== <!--T:11--> |
|||
<!--T:12--> |
|||
Only works if you are in Top view: [[Image:View-top.svg|Std_ViewTop|16px|link=Std_ViewTop]] [[Std_ViewTop|XY (top)]] |
|||
==Script== <!--T:10--> |
==Script== <!--T:10--> |
||
⚫ | |||
<!--T:13--> |
|||
ToolBar Icon [[Image:Macro Rotate View view 90 Degrees.png]] |
ToolBar Icon [[Image:Macro Rotate View view 90 Degrees.png]] |
||
⚫ | |||
'''Macro_Rotate_View_90_Degrees.FCMacro''' |
'''Macro_Rotate_View_90_Degrees.FCMacro''' |
||
{{ |
{{MacroCode|code= |
||
import math |
import math |
||
from pivy import coin |
from pivy import coin |
Latest revision as of 10:58, 30 December 2023
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: ToolBar Icon Author: Yorik |
Author |
Yorik |
Download |
ToolBar Icon |
Links |
Macros recipes How to install macros How to customize toolbars |
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: XY (top)
Script
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