Draft Move: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updated Options)
Line 49: Line 49:


==Options== <!--T:6-->
==Options== <!--T:6-->

The single character keyboard shortcuts available in the task panel can be changed. See [[Draft_Preferences|Draft Preferences]]. The shortcuts mentioned here are the default shortcuts.


<!--T:7-->
<!--T:7-->
* To manually enter coordinates enter the X, Y and Z component, and press {{KEY|Enter}} after each. Or you can press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button when you have the desired values. It is advisable to move the pointer out of the [[3D_view|3D view]] before entering coordinates.
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after a point to constrain the next point on the given axis.
* You can use polar coordinates for the second point. Enter a value for the {{MenuCommand|Length}} and a value for the {{MenuCommand|Angle}}, and press {{KEY|Enter}} after each.
* To enter coordinates manually, simply enter the numbers, then press {{KEY|Enter}} between each X, Y and Z component. You can press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button when you have the desired values to insert the point.
* Check the {{MenuCommand|Angle}} checkbox to constrain the pointer to the specified angle.
* Press {{KEY|R}} or click the checkbox to toggle ''relative'' mode. If relative mode is on, the coordinates of the next point are relative to the last one; if not, they are absolute, taken from the origin (0,0,0).
* Press {{KEY|T}} or click the checkbox to toggle ''continue'' mode. If continue mode is on, the Move tool will restart after you finish the operation, allowing you to move or copy the objects again without pressing the tool button again.
* Press {{KEY|R}} or click the {{MenuCommand|Relative}} checkbox to toggle relative mode. If relative mode is on, the coordinates of the second point are relative to the first point, else they are relative to the coordinate system origin.
* Press {{KEY|P}} or click the checkbox to toggle ''copy'' mode. If copy mode is on, the Move tool will keep the original shape in its place but will make a copy at the second point.
* Press {{KEY|G}} or click the {{MenuCommand|Global}} checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the [[Draft_SelectPlane|working plane]] coordinate system. {{Version|0.20}}
* Press {{KEY|T}} or click the {{MenuCommand|Continue}} checkbox to toggle continue mode. If continue mode is on, the command will restart after finishing. This mode really only makes sense if copy mode is switched on. Depending on the {{MenuCommand|Select base objects after copying}} setting, either the original objects are selected for the next command call or the copies that were created last. See [[#Preferences|Preferences]].
:You can use both {{KEY|T}} and {{KEY|P}} to place several copies in sequence. In this case, the duplicated element is the last placed copy.
* Hold {{KEY|Alt}} after the first point to also toggle copy mode. Keeping {{KEY|Alt}} pressed after clicking on the second point will allow you to continue placing copies; release {{KEY|Alt}} to finish the operation and see all copies.
* Press {{KEY|P}} or click the {{MenuCommand|Copy}} checkbox to toggle copy mode. If copy mode is on, the command will copy the selected objects instead of moving them.
* Press {{KEY|D}} or click the {{MenuCommand|Modify subelements}} checkbox to toggle subelements mode. If subelements mode is on, the command will.....
* Hold {{KEY|Ctrl}} while moving to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance.
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the command.
* Hold {{KEY|Shift}} while moving to [[Draft_Constrain|constrain]] your next point horizontally or vertically in relation to the last one.
* Press {{KEY|Esc}} or the {{button|Close}} button to abort the current command; copies already placed will remain.


== Notes ==
== Notes ==

Revision as of 09:31, 29 May 2021

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 Move

Menu location
Modification → Move
Workbenches
Draft, Arch
Default shortcut
M V
Introduced in version
0.7
See also
Draft Array, Draft PathArray

Description

The Move tool moves or copies the selected objects from one point to another.

The Move tool can be used on 2D shapes created with the Draft Workbench or Sketcher Workbench, but can also be used on many types of 3D objects such as those created with the Part Workbench or Arch Workbench.

To produce various copies in different arrangements use Draft Array, Draft PathArray and Draft PointArray.

Moving an object from one point to another point

Usage

  1. Select the objects that you wish to move or copy.
  2. Press the Draft Move button, or press M then V keys. If no object is selected, you will be invited to select one.
  3. Click a first point on the 3D view, or type a coordinate and press the add point button. This serves as the base point of the operation.
  4. Click another point on the 3D view, or type a coordinate and press the add point button. This is the new position of the base point.

Options

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts.

  • To manually enter coordinates enter the X, Y and Z component, and press Enter after each. Or you can press the Enter point button when you have the desired values. It is advisable to move the pointer out of the 3D view before entering coordinates.
  • You can use polar coordinates for the second point. Enter a value for the Length and a value for the Angle, and press Enter after each.
  • Check the Angle checkbox to constrain the pointer to the specified angle.
  • Press R or click the Relative checkbox to toggle relative mode. If relative mode is on, the coordinates of the second point are relative to the first point, else they are relative to the coordinate system origin.
  • Press G or click the Global checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the working plane coordinate system. introduced in version 0.20
  • Press T or click the Continue checkbox to toggle continue mode. If continue mode is on, the command will restart after finishing. This mode really only makes sense if copy mode is switched on. Depending on the Select base objects after copying setting, either the original objects are selected for the next command call or the copies that were created last. See Preferences.
  • Press P or click the Copy checkbox to toggle copy mode. If copy mode is on, the command will copy the selected objects instead of moving them.
  • Press D or click the Modify subelements checkbox to toggle subelements mode. If subelements mode is on, the command will.....
  • Press Esc or the Close button to abort the command.

Notes

  • An Object that is attached cannot be moved with the Draft Move command. To move it either its DataSupport object has to be moved, or its DataAttachment Offset has to be changed.

Preferences

See also: Preferences Editor and Draft Preferences.

  • To switch on copy mode by default check: Edit → Preferences... → Draft → General settings → Draft tools options → Global copy mode.
  • To reselect the base objects after copying objects check: Edit → Preferences... → Draft → General settings → Draft tools options → Select base objects after copying.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To move objects use the move method of the Draft module.

moved_list = move(objectslist, vector, copy=False)
  • objectslist contains the objects to be moved. It is either a single object or a list of objects.
  • vector is the displacement.
  • If copy is True copies are created instead of moving the original objects.
  • moved_list is returned with the original moved objects, or with the new copies. It is either a single object or a list of objects, depending on objectslist.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

polygon1 = Draft.make_polygon(5, radius=1000)
polygon2 = Draft.make_polygon(3, radius=500)
polygon3 = Draft.make_polygon(6, radius=220)

Draft.move(polygon1, App.Vector(500, 500, 0))
Draft.move(polygon1, App.Vector(500, 500, 0))
Draft.move(polygon2, App.Vector(1000, -1000, 0))
Draft.move(polygon3, App.Vector(-500, -500, 0))

list1 = [polygon1, polygon2, polygon3]

vector = App.Vector(-2000, -2000, 0)
list2 = Draft.move(list1, vector, copy=True)
list3 = Draft.move(list1, -2*vector, copy=True)

doc.recompute()