Macro Align Camera to Working Plane/en: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 16: Line 16:
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==
==Usage==
* Set the [[Draft SelectPlane|Draft Working Plane]] to your likings
* Set the [[Draft SelectPlane|Draft Working Plane]] to your likings
* Run the macro
* Run the macro
Line 25: Line 25:
'''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()

Revision as of 09:42, 23 May 2020

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)