Macro Rotate View/it: Difference between revisions

From FreeCAD Documentation
(heading)
(Updating to match new version of source page)
Line 1: Line 1:
{{Macro|Icon=Text-x-python|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}}
== Ruotare la Vista di 90°==


This macro rotates the current view by 90° to the left. Only works if you are in Top view
{{Macro/it|Icon=Text-x-python|Name=Rotate View by 90°|Name/it=Rotate View by 90°|Description=Questa macro ruota la vista corrente di 90° a sinistra. Funziona solo se si è in vista dall'alto|Author=Yorik}}



<syntaxhighlight>
import math
import math
from pivy import coin
from pivy import coin
Line 11: Line 13:
cam.orientation = nrot
cam.orientation = nrot


</syntaxhighlight>
{{clear}}
{{clear}}
<languages/>

{{languages/it | {{en|Macro_Rotate_View}} {{es|Macro_Rotate_View/es}} {{fr|Macro_Rotate_View/fr}} }}

Revision as of 17:20, 25 December 2013

File:Text-x-python 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

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


 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