Macro Align Working Plane to Camera: Difference between revisions
m (DATE ISO 8601 YYYY-MM-DD) |
Tag: Undo |
||
(13 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
⚫ | |||
<translate> |
<translate> |
||
<!--T:1--> |
<!--T:1--> |
||
{{Macro |
|||
⚫ | |||
⚫ | |||
|Icon=Macro_Align_Working_Plane_to_Camera.png |
|||
⚫ | |||
|Author=yorik |
|||
|Version=1.0 |
|||
|Date=2017-05-10 |
|||
|Download=[https://www.freecadweb.org/wiki/images/0/01/Macro_Align_Working_Plane_to_Camera.png ToolBar Icon] |
|||
|FCVersion=All |
|||
|SeeAlso=[[Macro_Align_Camera_to_Working_Plane|Macro Align Camera to Working Plane]] [[File:Macro_Align_Camera_to_Working_Plane.png|24px|Macro Align Camera to Working Plane]] |
|||
}} |
|||
==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. |
||
== |
==Usage== <!--T:6--> |
||
⚫ | |||
<!--T:3--> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
==Script== <!--T:4--> |
==Script== <!--T:4--> |
||
<!--T:7--> |
|||
ToolBar Icon |
|||
</translate> |
</translate> |
||
[[Image:Macro_Align_Working_Plane_to_Camera.png]] |
|||
⚫ | |||
'''Macro_Align_Working_Plane_to_Camera.FCMacro''' |
|||
⚫ | |||
⚫ | |||
import FreeCAD,FreeCADGui |
import FreeCAD,FreeCADGui |
||
cam = FreeCAD.Vector(FreeCADGui.ActiveDocument.ActiveView.getCameraNode().position.getValue().getValue()) |
cam = FreeCAD.Vector(FreeCADGui.ActiveDocument.ActiveView.getCameraNode().position.getValue().getValue()) |
||
Line 24: | Line 44: | ||
{{clear}} |
{{clear}} |
||
⚫ |
Latest revision as of 10:09, 21 December 2021
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 |
Macros recipes How to install macros How to customize toolbars |
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 |
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
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()