Macro Align Camera to Working Plane: Difference between revisions

From FreeCAD Documentation
m (date)
(Undo revision 1034758 by Roy 043 (talk))
Tag: Undo
 
(13 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>
<translate>
<translate>


<!--T:1-->
<!--T:1-->
{{Macro
{{Macro|Icon=Text-x-python|Name=Macro Align Camera to Working Plane|Description=This macro aligns the camera to the current [[Draft SelectPlane|Draft Working Plane]] |Author=yorik|Version=0.1|Date=16/03/2017}}
|Name=Macro Align Camera to Working Plane
|Icon=Macro_Align_Camera_to_Working_Plane.png
|Description=This macro aligns the camera to the current [[Draft SelectPlane|Draft Working Plane]]
|Author=yorik
|Version=0.1
|Date=2017-03-16
|Download=[https://www.freecadweb.org/wiki/images/f/fd/Macro_Align_Camera_to_Working_Plane.png ToolBar Icon]
|FCVersion=All
|SeeAlso=[[Macro Align Working Plane to Camera|Macro Align Working Plane to Camera]] [[File:Macro_Align_Working_Plane_to_Camera.png|24px]]
}}

==Description== <!--T:5-->


==Description== <!--T:2-->
<!--T:2-->
This macro aligns the camera to the current [[Draft SelectPlane|Draft Working Plane]]
This macro aligns the camera to the current [[Draft SelectPlane|Draft Working Plane]]


==How to use== <!--T:3-->
==Usage== <!--T:6-->

* Set the [[Draft SelectPlane|Draft Working Plane]] to your likings
<!--T:3-->
* Run the macro
* Set the [[Draft SelectPlane|Draft Working Plane]] to your liking.
* Run the macro.


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

<!--T:7-->
ToolBar Icon
</translate>
</translate>
[[Image:Macro_Align_Camera_to_Working_Plane.png]]
'''Macro Align Camera to Working Plane.FCMacro'''


'''Macro_Align_Camera_to_Working_Plane.FCMacro'''
{{Code|code=

{{MacroCode|code=
import FreeCAD,FreeCADGui
import FreeCAD,FreeCADGui
c = FreeCADGui.ActiveDocument.ActiveView.getCameraNode()
c = FreeCADGui.ActiveDocument.ActiveView.getCameraNode()
Line 23: Line 43:


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

Latest revision as of 10:07, 21 December 2021

Macro Align Camera to Working Plane

Description
This macro aligns the camera to the current Draft Working Plane

Macro version: 0.1
Last modified: 2017-03-16
FreeCAD version: All
Download: ToolBar Icon
Author: yorik
Author
yorik
Download
ToolBar Icon
Links
Macro Version
0.1
Date last modified
2017-03-16
FreeCAD Version(s)
All
Default shortcut
None
See also
Macro Align Working Plane to Camera

Description

This macro aligns the camera to the current Draft Working Plane

Usage

Script

ToolBar Icon

Macro_Align_Camera_to_Working_Plane.FCMacro

import FreeCAD,FreeCADGui
c = FreeCADGui.ActiveDocument.ActiveView.getCameraNode()
r = FreeCAD.DraftWorkingPlane.getRotation().Rotation.Q
c.orientation.setValue(r)