Draft WorkingPlaneProxy

From FreeCAD Documentation
Revision as of 11:28, 7 August 2021 by Roy 043 (talk | contribs)
This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

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 aligned with the current Draft working plane. It can be used to quickly restore that working plane. The camera position and visibility of the objects in the 3D view are saved in the object and can, optionally, also be restored.

Three working plane proxies showing different orientations and offsets

Usage

  1. Optionally change the working plane.
  2. Optionally change the 3D view. The created WP proxy stores the current camera settings.
  3. Optionally change the visibility state of objects in the document. The created WP proxy stores this information as well.
  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 WP proxy is created.
  6. To align the working plane with a WP proxy, double-click it in the Tree view or use it with the Draft SelectPlane command.

Tree view 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 WP proxy with the current 3D view camera settings.
  • Write objects state: updates the ViewVisibility Map property of the WP 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 WP proxy in the 3D view. See Placement.
  • Data (Hidden)Shape (Shape): specifies the shape of the WP 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 WP proxy.

Base

  • ViewLine Color (Color): specifies the color of all elements of the WP 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 WP proxy.
  • ViewRestore View (Bool): specifies if the ViewView Data is restored when the working plane is aligned with the WP proxy.
  • ViewTransparency (Percent): specifies the transparency of the face of the WP 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 Draft working plane. The Placement from the getPlacement method of the DraftWorkingPlane object can be used to create an aligned WP proxy. The Placement of a WP proxy in turn can be used to realign the Draft 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()