Macro Align Working Plane to Camera: Difference between revisions

From FreeCAD Documentation
m (Icon)
No edit summary
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:1-->
<!--T:1-->
{{Macro
{{Macro
Line 14: Line 15:
}}
}}


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

<!--T:2-->
This macro moves the current [[Draft SelectPlane|Draft Working Plane]] to the center of the current view. It is useful when you are working quite far from the grid center.
This macro moves the current [[Draft SelectPlane|Draft Working Plane]] to the center of the current view. It is useful when you are working quite far from the grid center.


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

* Move the view to the zone where you want to look at
<!--T:3-->
* Run the macro
* Move the view to the zone where you want to look at.
* Run the macro.


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

<!--T:7-->
ToolBar Icon
</translate>
</translate>
ToolBar Icon [[Image|Macro_Align_Working_Plane_to_Camera.png]]
[[Image:Macro_Align_Working_Plane_to_Camera.png]]


'''Macro_Align_Working_Plane_to_Camera.FCMacro'''
'''Macro_Align_Working_Plane_to_Camera.FCMacro'''

Revision as of 16:53, 14 September 2021

Other languages:

Macro Align Working Plane to Camera

Description
This macro moves the current Draft Working Plane to the center of the current view

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

Description

This macro moves the current Draft Working Plane to the center of the current view. It is useful when you are working quite far from the grid center.

Usage

  • Move the view to the zone where you want to look at.
  • Run the macro.

Script

ToolBar Icon

Macro_Align_Working_Plane_to_Camera.FCMacro

import FreeCAD,FreeCADGui
cam = FreeCAD.Vector(FreeCADGui.ActiveDocument.ActiveView.getCameraNode().position.getValue().getValue())
pos = FreeCAD.DraftWorkingPlane.projectPoint(cam)
FreeCAD.DraftWorkingPlane.position = pos
FreeCADGui.Snapper.setGrid()