Draft WorkingPlaneProxy: Difference between revisions

From FreeCAD Documentation
(Added Draft_Snap_Center.svg)
No edit summary
Line 23: Line 23:


<!--T:2-->
<!--T:2-->
The [[Image:Draft_WorkingPlaneProxy.svg|24px]] '''Draft WorkingPlaneProxy''' command creates a working plane proxy to save the current [[Draft_SelectPlane|Draft working plane]]. A WP proxy can be used to quickly restore a working plane. The camera position and visibility of the objects in the [[3D_view|3D view]] are also saved in the WP proxy and can, [[#Properties|optionally]], be restored as well.
The [[Image:Draft_WorkingPlaneProxy.svg|24px]] '''Draft WorkingPlaneProxy''' command creates a working plane proxy to save the current [[Draft_SelectPlane|Draft working plane]]. A working plane proxy can be used to quickly restore a working plane. The camera position and visibility of the objects in the [[3D_view|3D view]] are also saved in the working plane proxy and can, [[#Properties|optionally]], be restored as well.


</translate>
</translate>
Line 40: Line 40:
#* Press the {{Button|[[Image:Draft_WorkingPlaneProxy.svg|16px]] [[Draft_WorkingPlaneProxy|Draft WorkingPlaneProxy]]}} button.
#* Press the {{Button|[[Image:Draft_WorkingPlaneProxy.svg|16px]] [[Draft_WorkingPlaneProxy|Draft WorkingPlaneProxy]]}} button.
#* Select the {{MenuCommand|Utilities → [[Image:Draft_WorkingPlaneProxy.svg|16px]] Create working plane proxy}} option from the menu.
#* Select the {{MenuCommand|Utilities → [[Image:Draft_WorkingPlaneProxy.svg|16px]] Create working plane proxy}} option from the menu.
# A WP proxy is created.
# A working plane proxy is created.
# To align the [[Draft_SelectPlane|working plane]] with a WP proxy, double-click the WP proxy in the [[Tree_view|Tree view]] or use it with the [[Draft_SelectPlane|Draft SelectPlane]] command.
# To align the [[Draft_SelectPlane|working plane]] with a working plane proxy, double-click the working plane proxy in the [[Tree_view|Tree view]] or use it with the [[Draft_SelectPlane|Draft SelectPlane]] command.


== Context menu == <!--T:24-->
== Context menu == <!--T:24-->
Line 49: Line 49:


<!--T:26-->
<!--T:26-->
* {{MenuCommand|[[Image:Draft_SelectPlane.svg|16px]] Write camera position}}: updates the {{PropertyView|View Data}} property of the WP proxy with the current [[3D_view|3D view]] camera settings.
* {{MenuCommand|[[Image:Draft_SelectPlane.svg|16px]] Write camera position}}: updates the {{PropertyView|View Data}} property of the working plane proxy with the current [[3D_view|3D view]] camera settings.
* {{MenuCommand|[[Image:Draft_SelectPlane.svg|16px]] Write objects state}}: updates the {{PropertyView|Visibility Map}} property of the WP proxy with the current visibility state of objects in the document.
* {{MenuCommand|[[Image:Draft_SelectPlane.svg|16px]] Write objects state}}: updates the {{PropertyView|Visibility Map}} property of the working plane proxy with the current visibility state of objects in the document.


==Notes== <!--T:27-->
==Notes== <!--T:27-->


<!--T:11-->
<!--T:11-->
* WP proxies can be [[Draft_Move|moved]] and [[Draft_Rotate|rotated]] like any other object. Use [[Image:Draft_Snap_Center.svg|16px]] [[Draft_Snap_Center|Draft Snap Center]] to snap to their {{PropertyData|Placement}} point.
* Working plane proxies can be [[Draft_Move|moved]] and [[Draft_Rotate|rotated]] like any other object. Use [[Image:Draft_Snap_Center.svg|16px]] [[Draft_Snap_Center|Draft Snap Center]] to snap to their {{PropertyData|Placement}} point.


==Properties== <!--T:7-->
==Properties== <!--T:7-->


<!--T:28-->
<!--T:28-->
See also: [[property_editor|Property editor]].
See also: [[Property_editor|Property editor]].


<!--T:29-->
<!--T:29-->
Line 71: Line 71:


<!--T:8-->
<!--T:8-->
* {{PropertyData|Placement|Placement}}: specifies the position of the WP proxy in the [[3D view|3D view]]. See [[Placement|Placement]].
* {{PropertyData|Placement|Placement}}: specifies the position of the working plane proxy in the [[3D_view|3D view]]. See [[Placement|Placement]].
* {{PropertyData|Shape|Shape|Hidden}}: specifies the shape of the WP proxy.
* {{PropertyData|Shape|Shape|Hidden}}: specifies the shape of the working plane proxy.


=== View === <!--T:32-->
=== View === <!--T:32-->
Line 81: Line 81:
<!--T:12-->
<!--T:12-->
* {{PropertyView|Arrow Size|Length}}: specifies the size of the arrow symbols displayed at the tip of the three axes.
* {{PropertyView|Arrow Size|Length}}: specifies the size of the arrow symbols displayed at the tip of the three axes.
* {{PropertyView|Display Size|Length}}: specifies the length and width of the WP proxy.
* {{PropertyView|Display Size|Length}}: specifies the length and width of the working plane proxy.


<!--T:34-->
<!--T:34-->
Line 87: Line 87:


<!--T:35-->
<!--T:35-->
* {{PropertyView|Line Color|Color}}: specifies the color of all elements of the WP proxy.
* {{PropertyView|Line Color|Color}}: specifies the color of all elements of the working plane proxy.
* {{PropertyView|Line Width|Float}}: specifies the line width of the axes and arrow symbols.
* {{PropertyView|Line Width|Float}}: specifies the line width of the axes and arrow symbols.
* {{PropertyView|Restore State|Bool}}: specifies if the {{PropertyView|Visibility Map}} is restored when the [[Draft_SelectPlane|working plane]] is aligned with the WP proxy.
* {{PropertyView|Restore State|Bool}}: specifies if the {{PropertyView|Visibility Map}} is restored when the [[Draft_SelectPlane|working plane]] is aligned with the working plane proxy.
* {{PropertyView|Restore View|Bool}}: specifies if the {{PropertyView|View Data}} is restored when the [[Draft_SelectPlane|working plane]] is aligned with the WP proxy.
* {{PropertyView|Restore View|Bool}}: specifies if the {{PropertyView|View Data}} is restored when the [[Draft_SelectPlane|working plane]] is aligned with the working plane proxy.
* {{PropertyView|Transparency|Percent}}: specifies the transparency of the face of the WP proxy.
* {{PropertyView|Transparency|Percent}}: specifies the transparency of the face of the working plane proxy.
* {{PropertyView|View Data|FloatList}}: specifies the camera position and settings.
* {{PropertyView|View Data|FloatList}}: specifies the camera position and settings.
* {{PropertyView|Visibility Map|Map|Hidden}}: specifies the visibility state of objects.
* {{PropertyView|Visibility Map|Map|Hidden}}: specifies the visibility state of objects.
Line 98: Line 98:


<!--T:13-->
<!--T:13-->
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:14-->
<!--T:14-->
Line 104: Line 104:


<!--T:15-->
<!--T:15-->
If the [[Draft_Module|Draft Workbench]] is active the FreeCAD application object has a {{incode|DraftWorkingPlane}} property which stores the current working plane. The {{Incode|Placement}} from the {{Incode|getPlacement}} method of the {{incode|DraftWorkingPlane}} object can be used to create an aligned WP proxy. The {{Incode|Placement}} of a WP proxy in turn can be used to realign the working plane.
If the [[Draft_Module|Draft Workbench]] is active the FreeCAD application object has a {{incode|DraftWorkingPlane}} property which stores the current working plane. The {{Incode|Placement}} from the {{Incode|getPlacement}} method of the {{incode|DraftWorkingPlane}} object can be used to create an aligned working plane proxy. The {{Incode|Placement}} of a working plane proxy in turn can be used to realign the working plane.


</translate>
</translate>

Revision as of 19:39, 12 August 2021

Draft WorkingPlaneProxy

Menu location
Utilities → Create working plane proxy
Workbenches
Draft, Arch
Default shortcut
None
Introduced in version
-
See also
Draft SelectPlane

Description

The Draft WorkingPlaneProxy command creates a working plane proxy to save the current Draft working plane. A working plane proxy can be used to quickly restore a working plane. The camera position and visibility of the objects in the 3D view are also saved in the working plane proxy and can, optionally, be restored as well.

Three working plane proxies showing different orientations and offsets

Usage

  1. Optionally change the working plane.
  2. Optionally change the 3D view.
  3. Optionally change the visibility state of objects in the document.
  4. There are several ways to invoke the command:
    • Press the Draft WorkingPlaneProxy button.
    • Select the Utilities → Create working plane proxy option from the menu.
  5. A working plane proxy is created.
  6. To align the working plane with a working plane proxy, double-click the working plane proxy in the Tree view or use it with the Draft SelectPlane command.

Context menu

For a Draft WorkingPlaneProxy these additional options are available in the Tree view context menu:

  • Write camera position: updates the ViewView Data property of the working plane proxy with the current 3D view camera settings.
  • Write objects state: updates the ViewVisibility Map property of the working plane proxy with the current visibility state of objects in the document.

Notes

Properties

See also: Property editor.

A Draft WorkingPlaneProxy object is derived from an App FeaturePython object and inherits all its properties. It also has the following additional properties:

Data

Base

  • DataPlacement (Placement): specifies the position of the working plane proxy in the 3D view. See Placement.
  • Data (Hidden)Shape (Shape): specifies the shape of the working plane proxy.

View

Arch

  • ViewArrow Size (Length): specifies the size of the arrow symbols displayed at the tip of the three axes.
  • ViewDisplay Size (Length): specifies the length and width of the working plane proxy.

Base

  • ViewLine Color (Color): specifies the color of all elements of the working plane proxy.
  • ViewLine Width (Float): specifies the line width of the axes and arrow symbols.
  • ViewRestore State (Bool): specifies if the ViewVisibility Map is restored when the working plane is aligned with the working plane proxy.
  • ViewRestore View (Bool): specifies if the ViewView Data is restored when the working plane is aligned with the working plane proxy.
  • ViewTransparency (Percent): specifies the transparency of the face of the working plane proxy.
  • ViewView Data (FloatList): specifies the camera position and settings.
  • View (Hidden)Visibility Map (Map): specifies the visibility state of objects.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To create a Draft WorkingPlaneProxy use the make_workingplaneproxy method of the Draft module.

If the Draft Workbench is active the FreeCAD application object has a DraftWorkingPlane property which stores the current working plane. The Placement from the getPlacement method of the DraftWorkingPlane object can be used to create an aligned working plane proxy. The Placement of a working plane proxy in turn can be used to realign the working plane.

# This code only works if the Draft Workbench is active!

import FreeCAD as App
import FreeCADGui as Gui
import Draft

doc = App.newDocument()

workplane = App.DraftWorkingPlane
place = workplane.getPlacement()

proxy = Draft.make_workingplaneproxy(place)
proxy.ViewObject.DisplaySize = 3000
proxy.ViewObject.ArrowSize = 200

axis2 = App.Vector(1, 1, 1)
point2 = App.Vector(3000, 0, 0)
place2 = App.Placement(point2, App.Rotation(axis2, 90))

proxy2 = Draft.make_workingplaneproxy(place2)
proxy2.ViewObject.DisplaySize = 3000
proxy2.ViewObject.ArrowSize = 200

workplane.setFromPlacement(proxy2.Placement, rebase=True)
Gui.Snapper.setGrid()

doc.recompute()