Draft Move: Difference between revisions

From FreeCAD Documentation
(Can be used with Sketcher, Part, Arch, many objects.)
No edit summary
(28 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<!--T:35-->
{{Docnav
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]]
|[[Draft_Rotate|Rotate]]
|[[Draft_Module|Draft]]
|IconL=Draft_AnnotationStyleEditor.svg
|IconR=Draft_Rotate.svg
|IconC=Workbench_Draft.svg
}}

<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand
|Name=Draft Move
|Name=Draft Move
|MenuLocation=Draft → Move
|MenuLocation=Draft → Move
|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]]
|Shortcut=M V
|Shortcut={{KEY|M}} {{KEY|V}}
|SeeAlso=[[Draft Array]], [[Path Array]]
|Version=0.7
|Version=0.7
|SeeAlso=[[Draft_Array|Draft Array]], [[Draft_PathArray|Draft PathArray]]
}}
}}


Line 14: Line 24:


<!--T:3-->
<!--T:3-->
The Move tool moves or copies the selected objects from one point to another. If no object is selected, you will be invited to select one.
The Move tool moves or copies the selected objects from one point to another.


<!--T:31-->
To produce various copies in different arrangements use [[Draft Array]], [[Draft PathArray]] and [[Draft PointArray]].
The Move tool can be used on 2D shapes created with the [[Draft_Workbench|Draft Workbench]] or [[Sketcher_Workbench|Sketcher Workbench]], but can also be used on many types of 3D objects such as those created with the [[Part_Workbench|Part Workbench]] or [[Arch_Workbench|Arch Workbench]].

<!--T:32-->
To produce various copies in different arrangements use [[Draft_Array|Draft Array]], [[Draft_PathArray|Draft PathArray]] and [[Draft_PointArray|Draft PointArray]].


</translate>
</translate>
[[Image:Draft_Move_example.jpg|400px]]
[[Image:Draft_Move_example.jpg|400px]]
<translate>
<translate>
<!--T:33-->
{{Caption|Moving an object from one point to another point}}


==How to use== <!--T:4-->
==Usage== <!--T:4-->


<!--T:5-->
<!--T:5-->
# Select the objects you wish to move or copy.
# Select the objects that you wish to move or copy.
# Press the {{Button|[[Image:Draft Move.svg|16px]] [[Draft Move]]}} button, or press {{KEY|M}} then {{KEY|V}} keys.
# Press the {{Button|[[Image:Draft Move.svg|16px]] [[Draft_Move|Draft Move]]}} button, or press {{KEY|M}} then {{KEY|V}} keys. If no object is selected, you will be invited to select one.
# Click a first point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button. This serves as the base point of the operation.
# Click a first point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button. This serves as the base point of the operation.
# Click another point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button. This is the new position of the base point.
# Click another point on the 3D view, or type a [[Draft_Coordinates|coordinate]] and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] [[Draft_AddPoint|add point]]}} button. This is the new position of the base point.


===Limitations=== <!--T:12-->
The move operation 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 Workbnech]].
When moving an object that is based on a [[Sketcher_Sketch|Sketcher Sketch]], for example, a feature created with the [[PartDesign_Workbench|PartDesign Workbench]] ([[PartDesign_Pad|Pad]], [[PartDesign_Revolution|Revolution]], etc.) you must move the original sketch. If you move the derived object, it will just go back to the position defined by the sketch.


==Options== <!--T:6-->
==Options== <!--T:6-->
Line 39: Line 56:
* 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|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|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|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 in the second point.
* 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.
: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.
: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.
* 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.
Line 47: Line 64:


==Scripting== <!--T:8-->
==Scripting== <!--T:8-->
{{emphasis|See also:}} [[FreeCAD Scripting Basics]], [[Draft API]], and the [https://www.freecadweb.org/api autogenerated API documentation].
{{emphasis|See also:}} [[Draft_API|Draft API]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:9-->
<!--T:9-->
The Move tool can be used in [[macros]] and from the [[Python]] console by using the following function:
The Move tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by using the following function:


</translate>
</translate>
Line 59: Line 76:
<translate>
<translate>
<!--T:10-->
<!--T:10-->
* Moves the base point of the objects in {{incode|objectlist}} by the displacement and direction indicated by {{incode|vector}}.
* Moves the base point of the objects in {{incode|objectslist}} by the displacement and direction indicated by {{incode|vector}}.
** {{incode|objectslist}} is either a single object or a list of objects.
:This vector is relative to the base point of the object, which means that if an object is moved 2 units, and then another 2 units, it will have moved 4 units in total from its original position.
:The displacement vector is relative to the base point of the object, which means that if an object is moved 2 units, and then another 2 units, it will have moved 4 units in total from its original position.
* If {{incode|copy}} is {{incode|True}} copies are created instead of moving the original objects.
* If {{incode|copy}} is {{incode|True}} copies are created instead of moving the original objects.
* {{incode|movedlist}} is returned with the original moved objects, or with the new copies.
* {{incode|movedlist}} is returned with the original moved objects, or with the new copies.
** {{incode|movedlist}} is either a single object or a list of objects, depending on the input {{incode|objectslist}}.


<!--T:11-->
<!--T:11-->
Line 80: Line 99:
Draft.move(Polygon3, FreeCAD.Vector(-500, -500, 0))
Draft.move(Polygon3, FreeCAD.Vector(-500, -500, 0))


# Select the objects to create a selection list
List1 = [Polygon1, Polygon2, Polygon3]
List1 = [Polygon1, Polygon2, Polygon3]


Line 89: Line 107:
<translate>
<translate>


==Limitations== <!--T:12-->
<!--T:34-->
{{Docnav
* When moving a document object that is based on a [[Sketcher Sketch]], for example, a [[PartDesign Pad]] or [[PartDesign Revolution]], you must move the original sketch. If you move the derived object, it will just go back to the position defined by the sketch.
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]]

|[[Draft_Rotate|Rotate]]
== Snapping, Constraining, and more == <!--T:13-->
|[[Draft_Module|Draft]]

|IconL=Draft_AnnotationStyleEditor.svg
=== Preferences === <!--T:14-->
|IconR=Draft_Rotate.svg

|IconC=Workbench_Draft.svg
<!--T:15-->
}}
Moving is affected by the snapping preferences found in [[Draft Preferences]]. Go to {{MenuCommand|Edit → Preferences → Draft → Grid and snapping}}.

<!--T:18-->
[[File:Pref_Draft_Snapping.png]]

<!--T:19-->
By default the option "Always snap (disable snap mod)" is active, which means that you don't need to press a modifier key to activate the snapping tools. The default keys are:

<!--T:20-->
* {{KEY|Shift}} constraint modifier, to constraint the movement of the cursor along the X, Y, or Z axis.
* {{KEY|Ctrl}} snap modifier, to snap the cursor to specific modes given by [[Draft Snap]].
* {{KEY|Alt}} alternative modifier, to activate an alternative function for the tool.

=== Moving along a specific axis === <!--T:21-->

<!--T:22-->
In order to move along a specific axis, you must first select a working plane containing this axis (see the [[Draft_SelectPlane|selecting working plane]] page for more information).

<!--T:23-->
After selecting the first point to move, start to move roughly in the axis direction and hold the {{KEY|SHIFT}} key. FreeCAD will automatically find which axis you are trying to follow and stick to this axis.

<!--T:24-->
(This tool is especially powerful if you want to align a point to another one, regarding to an axis only).

<!--T:25-->
More on constrain move [[Draft_Constrain|here]]

=== Snapping === <!--T:26-->

<!--T:27-->
If you have a point that you want to directly match on a solid, you can use snapping see the [[Draft_Snap|snapping]] page on how to activate the snap. Select the first point (using snap or not), and then hover to the second point until you see it highlighted.

<!--T:28-->
By default the snapping mode is activated, but you may have it deactivated in the preferences (see preceding section), in that case, you will have to hold the Snapping key {{KEY|Ctrl}} by default.

=== Alt Mode === <!--T:29-->

<!--T:30-->
Alt mode allows you to copy and object instead of moving it only.


</translate>
</translate>
{{Draft Tools navi{{#translation:}}}}

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

Revision as of 16:57, 19 December 2020

Draft Move

Menu location
Draft → 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.

Limitations

When moving an object that is based on a Sketcher Sketch, for example, a feature created with the PartDesign Workbench (Pad, Revolution, etc.) you must move the original sketch. If you move the derived object, it will just go back to the position defined by the sketch.

Options

  • Press X, Y or Z after a point to constrain the next point on the given axis.
  • To enter coordinates manually, simply enter the numbers, then press Enter between each X, Y and Z component. You can press the add point button when you have the desired values to insert the point.
  • Press 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 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 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.
You can use both T and P to place several copies in sequence. In this case, the duplicated element is the last placed copy.
  • Hold Alt after the first point to also toggle copy mode. Keeping Alt pressed after clicking on the second point will allow you to continue placing copies; release Alt to finish the operation and see all copies.
  • Hold Ctrl while moving to force snapping your point to the nearest snap location, independently of the distance.
  • Hold Shift while moving to constrain your next point horizontally or vertically in relation to the last one.
  • Press Esc or the Close button to abort the current command; copies already placed will remain.

Scripting

See also: Draft API and FreeCAD Scripting Basics.

The Move tool can be used in macros and from the Python console by using the following function:

movedlist = move(objectslist, vector, copy=False)
  • Moves the base point of the objects in objectslist by the displacement and direction indicated by vector.
    • objectslist is either a single object or a list of objects.
The displacement vector is relative to the base point of the object, which means that if an object is moved 2 units, and then another 2 units, it will have moved 4 units in total from its original position.
  • If copy is True copies are created instead of moving the original objects.
  • movedlist is returned with the original moved objects, or with the new copies.
    • movedlist is either a single object or a list of objects, depending on the input objectslist.

Example:

import FreeCAD, Draft

Polygon1 = Draft.makePolygon(5, radius=1000)
Polygon2 = Draft.makePolygon(3, radius=500)
Polygon3 = Draft.makePolygon(6, radius=220)

Draft.move(Polygon1, FreeCAD.Vector(500, 500, 0))
Draft.move(Polygon1, FreeCAD.Vector(500, 500, 0))
Draft.move(Polygon2, FreeCAD.Vector(1000, -1000, 0))
Draft.move(Polygon3, FreeCAD.Vector(-500, -500, 0))

List1 = [Polygon1, Polygon2, Polygon3]

vector = FreeCAD.Vector(-2000, -2000, 0)
List2 = Draft.move(List1, vector, copy=True)
List3 = Draft.move(List1, -2*vector, copy=True)