Draft Move: Difference between revisions
(Added 'In progress') |
No edit summary |
||
(58 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Page_in_progress}} |
|||
<languages/> |
<languages/> |
||
<translate> |
<translate> |
||
Line 7: | Line 6: | ||
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]] |
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]] |
||
|[[Draft_Rotate|Rotate]] |
|[[Draft_Rotate|Rotate]] |
||
|[[ |
|[[Draft_Workbench|Draft]] |
||
|IconL=Draft_AnnotationStyleEditor.svg |
|IconL=Draft_AnnotationStyleEditor.svg |
||
|IconR=Draft_Rotate.svg |
|IconR=Draft_Rotate.svg |
||
Line 17: | Line 16: | ||
|Name=Draft Move |
|Name=Draft Move |
||
|MenuLocation=Modification → Move |
|MenuLocation=Modification → Move |
||
|Workbenches=[[ |
|Workbenches=[[Draft_Workbench|Draft]], [[Arch_Workbench|Arch]] |
||
|Shortcut={{KEY|M}} {{KEY|V}} |
|Shortcut={{KEY|M}} {{KEY|V}} |
||
|Version=0.7 |
|Version=0.7 |
||
|SeeAlso=[[ |
|SeeAlso=[[Draft_SubelementHighlight|Draft SubelementHighlight]] |
||
}} |
}} |
||
Line 26: | Line 25: | ||
<!--T:3--> |
<!--T:3--> |
||
The Move |
The [[Image:Draft_Move.svg|24px]] '''Draft Move''' command moves or copies selected objects from one point to another. In subelement mode the command moves selected points and edges, or copies selected edges, of [[Draft_Line|Draft Lines]] and [[Draft_Wire|Draft Wires]]. |
||
<!--T:31--> |
<!--T:31--> |
||
The |
The command can be used on 2D objects created with the [[Draft_Workbench|Draft Workbench]] or [[Sketcher_Workbench|Sketcher Workbench]], but also on many 3D objects such as those created with the [[Part_Workbench|Part Workbench]], [[PartDesign_Workbench|PartDesign Workbench]] or [[Arch_Workbench|Arch Workbench]]. |
||
⚫ | |||
To produce various copies in different arrangements use [[Draft_Array|Draft Array]], [[Draft_PathArray|Draft PathArray]] and [[Draft_PointArray|Draft PointArray]]. |
|||
</translate> |
</translate> |
||
Line 38: | Line 34: | ||
<translate> |
<translate> |
||
<!--T:33--> |
<!--T:33--> |
||
{{Caption|Moving an object from one point to another |
{{Caption|Moving an object from one point to another}} |
||
==Usage== <!--T:4--> |
==Usage== <!--T:4--> |
||
⚫ | |||
See also: [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]]. |
|||
<!--T:5--> |
<!--T:5--> |
||
# Optionally select one or more objects, or one or more subelements of [[Draft_Line|Draft Lines]] or [[Draft_Wire|Draft Wires]]. |
|||
# Select the objects that you wish to move or copy. |
|||
# There are several ways to invoke the command: |
|||
# 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. |
|||
# |
#* Press the {{Button|[[Image:Draft_Move.svg|16px]] [[Draft_Move|Move]]}} button. |
||
#* Select the {{MenuCommand|Modification → [[Image:Draft_Move.svg|16px]] Move}} option from the menu. |
|||
⚫ | |||
#* Use the keyboard shortcut: {{KEY|M}} then {{KEY|V}}. |
|||
# If you have not yet selected an object: select an object in the [[3D_view|3D view]]. |
|||
# The {{MenuCommand|Move}} task panel opens. See [[#Options|Options]] for more information. |
|||
# If subelements have been selected: check the {{MenuCommand|Modify subelements}} checkbox to switch on subelement mode. |
|||
⚫ | |||
# Pick the second point, the target point, in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button. |
|||
==Options== <!--T:6--> |
|||
<!--T:41--> |
|||
===Limitations=== |
|||
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 (for version 0.22). |
|||
<!--T: |
<!--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. |
||
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. |
|||
* To use polar coordinates enter a value for the {{MenuCommand|Length}} and a value for the {{MenuCommand|Angle}}, and press {{KEY|Enter}} after each. |
|||
* Check the {{MenuCommand|Angle}} checkbox to constrain the pointer to the specified angle. |
|||
* Press {{KEY|L}} to change the focus from the {{MenuCommand|X}} input box to the {{MenuCommand|Length}} input box and back. Depending on the input box that receives the focus the {{MenuCommand|Angle}} checkbox is checked or unchecked. |
|||
⚫ | |||
* 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|N}} 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}} preference, either the original objects are selected for the next command call or the copies that were created last. See [[#Preferences|Preferences]]. |
|||
⚫ | |||
* Press {{KEY|B}} or click the {{MenuCommand|Modify subelements}} checkbox to toggle subelement mode. If subelement mode is on, the command will use the selected subelements instead of the whole objects. The subelements must belong to [[Draft_Line|Draft Lines]] or [[Draft_Wire|Draft Wires]]. |
|||
* If copy mode and subelement mode are both on, and edges of [[Draft_Wire|Draft Wires]] are selected, new wires will be created from those edges. |
|||
⚫ | |||
* Press {{KEY|S}} to switch [[Draft_Snap|Draft snapping]] on or off. |
|||
⚫ | |||
== |
==Notes== <!--T:42--> |
||
<!--T: |
<!--T:43--> |
||
* An Object that is [[Part_EditAttachment|attached]] cannot be moved with the Draft Move command. To move it either its {{PropertyData|Support}} object has to be moved, or its {{PropertyData|Attachment Offset}} has to be changed. |
|||
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after a point to constrain the next point on the given axis. |
|||
⚫ | |||
⚫ | |||
* 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. |
|||
⚫ | |||
: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|Ctrl}} while moving to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance. |
|||
* Hold {{KEY|Shift}} while moving to [[Draft_Constrain|constrain]] your next point horizontally or vertically in relation to the last one. |
|||
⚫ | |||
==Preferences== <!--T:44--> |
|||
⚫ | |||
<!--T:45--> |
|||
See also: [[Preferences_Editor|Preferences Editor]] and [[Draft_Preferences|Draft Preferences]]. |
|||
<!--T:46--> |
|||
* To change the initial focus of the task panel to the {{MenuCommand|Length}} input box: {{MenuCommand|Edit → Preferences... → Draft → General → Set focus on Length instead of X coordinate}}. Note that you must move the pointer in the [[3D_view|3D view]] for the change to take effect. |
|||
* To reselect the base objects after copying objects: {{MenuCommand|Edit → Preferences... → Draft → General → Select base objects after copying}}. |
|||
⚫ | |||
<!--T:8--> |
<!--T:8--> |
||
See also: [https:// |
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]]. |
||
<!--T:9--> |
<!--T:9--> |
||
To move objects use the {{incode|move}} method of the Draft module. |
|||
The Move tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by using the following function: |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
moved_list = move(objectslist, vector, copy=False) |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:10--> |
<!--T:10--> |
||
* {{incode|objectslist}} contains the objects to be moved. It is either a single object or a list of objects. |
|||
* Moves the base point of the objects in {{incode|objectslist}} by the displacement and direction indicated by {{incode|vector}}. |
|||
* {{incode|vector}} is the displacement. |
|||
: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| |
* {{incode|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 {{incode|objectslist}}. |
||
** {{incode|movedlist}} is either a single object or a list of objects, depending on the input {{incode|objectslist}}. |
|||
<!--T:11--> |
<!--T:11--> |
||
Line 95: | Line 112: | ||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import FreeCAD |
import FreeCAD as App |
||
import Draft |
|||
doc = App.newDocument() |
|||
⚫ | |||
⚫ | |||
polygon3 = Draft.make_polygon(6, radius=220) |
|||
⚫ | |||
⚫ | |||
Draft.move(polygon1, App.Vector(500, 500, 0)) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
list1 = [polygon1, polygon2, polygon3] |
|||
⚫ | |||
Draft.move(Polygon1, FreeCAD.Vector(500, 500, 0)) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
List1 = [Polygon1, Polygon2, Polygon3] |
|||
⚫ | |||
⚫ | |||
doc.recompute() |
|||
⚫ | |||
⚫ | |||
⚫ | |||
}} |
}} |
||
<translate> |
<translate> |
||
Line 119: | Line 141: | ||
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]] |
|[[Draft_AnnotationStyleEditor|AnnotationStyleEditor]] |
||
|[[Draft_Rotate|Rotate]] |
|[[Draft_Rotate|Rotate]] |
||
|[[ |
|[[Draft_Workbench|Draft]] |
||
|IconL=Draft_AnnotationStyleEditor.svg |
|IconL=Draft_AnnotationStyleEditor.svg |
||
|IconR=Draft_Rotate.svg |
|IconR=Draft_Rotate.svg |
Latest revision as of 18:37, 6 January 2024
Draft Move |
Menu location |
---|
Modification → Move |
Workbenches |
Draft, Arch |
Default shortcut |
M V |
Introduced in version |
0.7 |
See also |
Draft SubelementHighlight |
Description
The Draft Move command moves or copies selected objects from one point to another. In subelement mode the command moves selected points and edges, or copies selected edges, of Draft Lines and Draft Wires.
The command can be used on 2D objects created with the Draft Workbench or Sketcher Workbench, but also on many 3D objects such as those created with the Part Workbench, PartDesign Workbench or Arch Workbench.
Moving an object from one point to another
Usage
See also: Draft Snap and Draft Constrain.
- Optionally select one or more objects, or one or more subelements of Draft Lines or Draft Wires.
- There are several ways to invoke the command:
- Press the Move button.
- Select the Modification → Move option from the menu.
- Use the keyboard shortcut: M then V.
- If you have not yet selected an object: select an object in the 3D view.
- The Move task panel opens. See Options for more information.
- If subelements have been selected: check the Modify subelements checkbox to switch on subelement mode.
- Pick the first point, the base point, in the 3D view, or type coordinates and press the Enter point button.
- Pick the second point, the target point, in the 3D view, or type coordinates and press the Enter point button.
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 (for version 0.22).
- 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.
- To use polar coordinates 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 L to change the focus from the X input box to the Length input box and back. Depending on the input box that receives the focus the Angle checkbox is checked or unchecked.
- 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 N 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 preference, either the original objects are selected for the next command call or the copies that were created last. See Preferences.
- Press C or click the Copy checkbox to toggle copy mode. If copy mode is on, the command will create moved copies instead of moving the original objects.
- Press B or click the Modify subelements checkbox to toggle subelement mode. If subelement mode is on, the command will use the selected subelements instead of the whole objects. The subelements must belong to Draft Lines or Draft Wires.
- If copy mode and subelement mode are both on, and edges of Draft Wires are selected, new wires will be created from those edges.
- Holding down Alt after picking the base point will also toggle copy mode. While Alt is held down multiple target points can be picked. Release Alt to finish the command and see the created copies.
- Press S to switch Draft snapping on or off.
- 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 change the initial focus of the task panel to the Length input box: Edit → Preferences... → Draft → General → Set focus on Length instead of X coordinate. Note that you must move the pointer in the 3D view for the change to take effect.
- To reselect the base objects after copying objects: Edit → Preferences... → Draft → General → 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
isTrue
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 onobjectslist
.
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()
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path link array, Point array, Point link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap lock, Snap endpoint, Snap midpoint, Snap center, Snap angle, Snap intersection, Snap perpendicular, Snap extension, Snap parallel, Snap special, Snap near, Snap ortho, Snap grid, Snap working plane, Snap dimensions, Toggle grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub