Draft WorkingPlaneProxy/ru: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>

<div class="mw-translate-fuzzy">
{{Docnav/ru
{{Docnav/ru
|[[Draft AutoGroup/ru|AutoGroup]]
|[[Draft AutoGroup/ru|AutoGroup]]
Line 8: Line 10:
|IconR=Draft_AddConstruction.svg
|IconR=Draft_AddConstruction.svg
}}
}}
</div>


{{GuiCommand
{{GuiCommand
|Name=Draft WorkingPlaneProxy
|Name=Draft WorkingPlaneProxy
|MenuLocation=Draft → Utilities → Create working plane proxy
|MenuLocation=Utilities → Create working plane proxy
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]]
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]]
|SeeAlso=[[Draft_SelectPlane|Draft SelectPlane]]
|SeeAlso=[[Draft_SelectPlane|Draft SelectPlane]]
Line 18: Line 21:
==Описание==
==Описание==


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.
This command will place a Plane Proxy object aligned to the current [[Draft_SelectPlane|Working Plane]].

This proxy object can be used like a face to quickly change the working plane using the [[Draft_SelectPlane|Draft SelectPlane]] tool. The camera position and visibility of the objects in the 3D view can be saved in the proxy object, and restored at anytime when the [[Draft_SelectPlane|Draft SelectPlane]] tool is used.


[[Image:Draft WPProxy example.png|400px]]
[[Image:Draft WPProxy example.png|400px]]
Line 27: Line 28:
==Использование==
==Использование==


# Optionally change the [[Draft_SelectPlane|working plane]].
# Make sure the [[Draft SelectPlane|Working Plane]] is set as you want.
# Optionally change the [[3D_view|3D view]].
# Then go to the menu {{MenuCommand|Draft → Utilities → [[Image:Draft_WorkingPlaneProxy.svg|16px]] Create Working Plane Proxy}}.
# Optionally change the visibility state of objects in the document.
# There are several ways to invoke the command:
#* 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.
# A WP 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.

== Context menu ==

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

* {{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 objects state}}: updates the {{PropertyView|Visibility Map}} property of the WP proxy with the current visibility state of objects in the document.


==Notes==
==Notes==

* The working plane stored in the Proxy object can be restored by double-clicking the object in the tree view, or by selecting the Proxy object and using the {{Button|[[Image:Draft SelectPlane.svg|16px]] [[Draft_SelectPlane|Draft SelectPlane]]}} button.
* WP proxies can be [[Draft_Move|moved]] and [[Draft_Rotate|rotated]] like any other object. Use [[Draft_Snap_Center|Draft Snap Center]] to snap to their {{PropertyData|Placement}} point.
* The position of the camera is stored in the Proxy object upon creation. This position can be updated anytime: zoom, pan and rotate the view as you wish, then right-click the Proxy object in the tree view, and select {{Button|[[Image:Draft SelectPlane.svg|16px]] Write camera position}}.
* The visibility state of all objects is also stored in the Proxy object upon creation. This state can be updated anytime: set the {{PropertyView|Visibility}} property of the objects to {{TRUE}} or {{FALSE}} as desired, then right-click the Proxy object in the tree view, and select {{Button|[[Image:Draft SelectPlane.svg|16px]] Write objects state}}.
* Plane proxies can be moved and rotated like any other object so that they define the desired working plane. Their visual appearance can also be changed in the [[Property_editor|Property editor]].


==Properties==
==Properties==

See also: [[property_editor|Property editor]].

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


=== Data ===
=== Data ===

* {{PropertyData|Placement}}: specifies the position of the proxy object and the corresponding working plane.
{{TitleProperty|Base}}
** {{PropertyData|Position}}: specifies the coordinates of the proxy object.

** {{PropertyData|Angle}}: specifies the rotation angle of the proxy object.
** {{PropertyData|Axis}}: specifies the axis to use for the rotation angle.
* {{PropertyData|Placement|Placement}}: specifies the position of the WP proxy in the [[3D view|3D view]]. See [[Placement|Placement]].
* {{PropertyData|Shape|Shape|Hidden}}: specifies the shape of the WP proxy.


=== View ===
=== View ===
* {{PropertyView|Display Size}}: specifies both length and width of the proxy object. If the object is created in the tree view but no element is visible in the 3D view, increase this value until it is visible.
* {{PropertyView|Arrow Size}}: specifies the size of the arrows indicating the three axes of the plane proxy.
* {{PropertyView|Restore View}}: if it is {{TRUE}} the camera position will be restored to the saved position when using the proxy with {{Button|[[Image:Draft SelectPlane.svg|16px]] [[Draft_SelectPlane|Draft SelectPlane]]}} or by double-clicking on it.
* {{PropertyView|Restore State}}: if it is {{TRUE}} the visibility state of all objects will be restored to the saved state when using the proxy with {{Button|[[Image:Draft SelectPlane.svg|16px]] [[Draft_SelectPlane|Draft SelectPlane]]}} or by double-clicking on it.


{{TitleProperty|Arch}}
==Scripting==


* {{PropertyView|Arrow Size|Length}}: specifies the size of the arrow symbols displayed at the tip of the three axes.
{{Emphasis|See also:}} [[Draft_API|Draft API]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].
* {{PropertyView|Display Size|Length}}: specifies the length and width of the WP proxy.


{{TitleProperty|Base}}
Working plane proxy objects can be used in [[Macros|macros]] and from the [[Python|Python]] console by using the following function:
{{Code|code=
WPProxy = makeWorkingPlaneProxy(placement)
}}
* Creates a {{incode|WPProxy}} object from the given {{incode|placement}} which is a {{incode|FreeCAD.Placement}}.
** A placement is defined by a base point, given by its {{incode|FreeCAD.Vector}}, and a {{incode|FreeCAD.Rotation}}.


* {{PropertyView|Line Color|Color}}: specifies the color of all elements of the WP proxy.
The size of the Plane Proxy can be changed by overwriting its {{incode|ViewObject.DisplaySize}} and {{incode|ViewObject.ArrowSize}} attributes, with units in millimeters.
* {{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 View|Bool}}: specifies if the {{PropertyView|View Data}} is restored when the [[Draft_SelectPlane|working plane]] is aligned with the WP proxy.
* {{PropertyView|Transparency|Percent}}: specifies the transparency of the face of the WP proxy.
* {{PropertyView|View Data|FloatList}}: specifies the camera position and settings.
* {{PropertyView|Visibility Map|Map|Hidden}}: specifies the visibility state of objects.


==Scripting==
The Plane Proxy has a "Face" object as its {{incode|Shape}} attribute. This face can be used to set the current working plane by calling its {{incode|alignToFace()}} method.

See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].

To create a Draft WorkingPlaneProxy use the {{incode|make_workingplaneproxy}} method of the Draft module.

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.


Пример:
{{Code|code=
{{Code|code=
# This code only works if the Draft Workbench is active!
import FreeCAD, FreeCADGui, Draft


currentWP = FreeCAD.DraftWorkingPlane
import FreeCAD as App
import FreeCADGui as Gui
place = currentWP.getPlacement()
import Draft


doc = App.newDocument()
WPProxy = Draft.makeWorkingPlaneProxy(place)
WPProxy.ViewObject.DisplaySize = 3000
WPProxy.ViewObject.ArrowSize = 200


workplane = App.DraftWorkingPlane
YAxis = FreeCAD.Vector(0, 1, 0)
place = workplane.getPlacement()
point2 = FreeCAD.Vector(3000, 0, 0)
place2 = FreeCAD.Placement(point2, FreeCAD.Rotation(YAxis, 90))


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


Axis = FreeCAD.Vector(1, 1, 1)
axis2 = App.Vector(1, 1, 1)
point3 = FreeCAD.Vector(-3000, 3000, 0)
point2 = App.Vector(3000, 0, 0)
place3 = FreeCAD.Placement(point3, FreeCAD.Rotation(Axis, 90))
place2 = App.Placement(point2, App.Rotation(axis2, 90))


WPProxy3 = Draft.makeWorkingPlaneProxy(place3)
proxy2 = Draft.make_workingplaneproxy(place2)
WPProxy3.ViewObject.DisplaySize = 3000
proxy2.ViewObject.DisplaySize = 3000
WPProxy3.ViewObject.ArrowSize = 200
proxy2.ViewObject.ArrowSize = 200
FreeCAD.ActiveDocument.recompute()


workplane.setFromPlacement(proxy2.Placement, rebase=True)
currentWP.alignToFace(WPProxy3.Shape)
FreeCADGui.Snapper.setGrid()
Gui.Snapper.setGrid()

doc.recompute()
}}
}}



<div class="mw-translate-fuzzy">
{{Docnav/ru
{{Docnav/ru
|[[Draft AutoGroup/ru|AutoGroup]]
|[[Draft AutoGroup/ru|AutoGroup]]
Line 105: Line 126:
|IconR=Draft_AddConstruction.svg
|IconR=Draft_AddConstruction.svg
}}
}}
</div>



{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}

Revision as of 06:59, 11 August 2021

Draft WorkingPlaneProxy

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

Описание

The Draft WorkingPlaneProxy command creates a working plane proxy to save the current 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 are also saved in the WP proxy and can, optionally, be restored as well.

Three working plane proxies showing different orientations and offsets

Использование

  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 WP proxy is created.
  6. To align the working plane with a WP proxy, double-click the WP 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 ВидView Data property of the WP proxy with the current 3D view camera settings.
  • Write objects state: updates the ВидVisibility 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

  • ДанныеPlacement (Placement): specifies the position of the WP proxy in the 3D view. See Placement.
  • Данные (Hidden)Shape (Shape): specifies the shape of the WP proxy.

View

Arch

  • ВидArrow Size (Length): specifies the size of the arrow symbols displayed at the tip of the three axes.
  • ВидDisplay Size (Length): specifies the length and width of the WP proxy.

Base

  • ВидLine Color (Color): specifies the color of all elements of the WP proxy.
  • ВидLine Width (Float): specifies the line width of the axes and arrow symbols.
  • ВидRestore State (Bool): specifies if the ВидVisibility Map is restored when the working plane is aligned with the WP proxy.
  • ВидRestore View (Bool): specifies if the ВидView Data is restored when the working plane is aligned with the WP proxy.
  • ВидTransparency (Percent): specifies the transparency of the face of the WP proxy.
  • ВидView Data (FloatList): specifies the camera position and settings.
  • Вид (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 WP proxy. The Placement of a WP 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()