Draft Move/sv: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 9: Line 9:
Detta verktyg flyttar de markerade objekten från en punkt till en annan. Om inget objekt är valt, så kommer du ombes att välja ett.
Detta verktyg flyttar de markerade objekten från en punkt till en annan. Om inget objekt är valt, så kommer du ombes att välja ett.
</div>
</div>

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]].


[[Image:Draft_Move_example.jpg|400px]]
[[Image:Draft_Move_example.jpg|400px]]
{{Caption|Moving an object from one point to another point}}


==Bruk==
==Bruk==


<div class="mw-translate-fuzzy">
* Markera punkter i ett tomt område i 3d vyn, eller på ett existerande objekt.
* Markera punkter i ett tomt område i 3d vyn, eller på ett existerande objekt.
* Nedtryckning av {{KEY|CTRL}} kommer att [[Draft_Snap/sv|snäppa]] din punkt till tillgängliga snäpp-punkter.
* Nedtryckning av {{KEY|CTRL}} kommer att [[Draft_Snap/sv|snäppa]] din punkt till tillgängliga snäpp-punkter.
Line 22: Line 28:
* Nedtryckning av {{KEY|ALT}} kommer att skapa en kopia, även om kopieringsknappen är av.
* Nedtryckning av {{KEY|ALT}} kommer att skapa en kopia, även om kopieringsknappen är av.
* Om {{KEY|ALT}} är nedtryckt, så kan du göra multipla kopior ända tills {{KEY|ALT}} släpps.
* Om {{KEY|ALT}} är nedtryckt, så kan du göra multipla kopior ända tills {{KEY|ALT}} släpps.
</div>


===Limitations===
== Snapping, Constraining, and more ==
When moving an object that is based on a [[Sketcher Sketch]], for example, a feature created with the [[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.

=== Preferences ===

Moving object around in 3D can be dreadful, and is most likely '''not''' what you want. FreeCAD comes with a lot more power to move object around, but first you must check your preferences to see how to activate those commands.

Go to {{KEY|Edit}} -> {{KEY|Preferences}} -> {{KEY|DRAFT}}, then open the {{KEY|Grid and snapping}} tab.

You will see there several options:

[[File:Pref_Draft_Snapping.png]]

By default the option "Always snap (disable snap mod)" is activated, which means that the snapping tools will always be active (you don't need to press a key to activate them), note here what keys are assigned to activate the different modes, by default:

* {{KEY|SHIFT}} activate the {{KEY|Constrain}} mode (move along an axis vector only)
* {{KEY|Ctl}} activate the {{KEY|SNAP}} mode (cursor will snap on specific points)
* {{KEY|Alt}} activate the {{KEY|ALT}}

=== Moving along a specific axis ===

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).

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.

(This tool is especially powerful if you want to align a point to another one, regarding to an axis only).

More on constrain move [[Draft_Constrain|here]]

=== Snapping ===

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.

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 ===

Alt mode allows you to copy and object instead of moving it only.


==Options==
==Options==


* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after a point to constrain the next point on the given axis.
* Press {{KEY|X}}, {{KEY|Y}} or {{KEY|Z}} after a point to constrain the next point on the given axis.
* To enter coordinates manually, simply enter the numbers, then press {{KEY|ENTER}} between each X, Y and Z component.
* 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.
* Press {{KEY|R}} or click the checkbox to check/uncheck the {{KEY|'''Relative'''}} button. 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 (0,0,0) origin point.
* 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 check/uncheck the {{KEY|'''Continue'''}} button. If continue mode is on, the Move tool will restart after you finish or close it, allowing you to move or copy the objects another time without pressing the Move 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.
* Pressing {{KEY|ALT}} or {{KEY|C}} or clicking the {{KEY|'''Copy'''}} button will make a copy of the objects, instead of moving them. If you keep {{KEY|ALT}} pressed after clicking the second point, you will be able to place more copies, until you release the {{KEY|ALT}} key.
* 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.
* Press {{KEY|CTRL}} while drawing to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance.
* 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|SHIFT}} while drawing to [[Draft_Constrain|constrain]] your next point horizontally or vertically in relation to the last one.
* 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 {{KEY|'''Cancel'''}} button to abort the current 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.


==Scripting==
==Scripting==
{{emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]].


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


{{Code|code=
{{Code|code=
movedlist = move(objectslist, vector, copy=False)
move (FreeCAD.Object or list, Vector, [copymode])
}}
}}


* Moves the given object or the objects contained in the given list in the direction and distance indicated by the given 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.
* If copymode is True, the actual objects are not moved, but copies are created instead. Returns the object(s) (or their copies if copymode was True)
: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.
* A list of the moved object (or the copies) is returned
* 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 either a single object or a list of objects, depending on the input {{incode|objectslist}}.


Example:
Example:


{{Code|code=
{{Code|code=
import FreeCAD,Draft
import FreeCAD, Draft

Draft.move(FreeCAD.ActiveDocument.ActiveObject,FreeCAD.Vector(2,2,0))
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)
}}
}}

==Limitations==
{{Draft Tools navi}}
* When moving (or changing Placement of) a document object (eg: Pad, Revolution, etc) which is based on a Sketch (from Sketcher/Part Design), you must move the original sketch. If you move the derived object, it will just go back to the position defined by the sketch.
{{Userdocnavi}}
{{clear}}

Revision as of 13:03, 8 January 2019

Draft Move

Menyplacering
Draft -> Move
Arbetsbänkar
Draft, Arch
Standard genväg
M V
Introducerad i version
-
Se även
Ingen

Beskrivning

Detta verktyg flyttar de markerade objekten från en punkt till en annan. Om inget objekt är valt, så kommer du ombes att välja ett.

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

Bruk

  • Markera punkter i ett tomt område i 3d vyn, eller på ett existerande objekt.
  • Nedtryckning av CTRL kommer att snäppa din punkt till tillgängliga snäpp-punkter.
  • Nedtryckning av SKIFT kommer att begränsa dig vertikalt eller horisontellt i relation till startpunkten.
  • Om du trycker på ESC så avbryts funktionen.
  • Skriv in siffror för att manuellt mata in en koordinat.
  • C växlar kopieringsläget på/av. Med kopiering på, så kommer objekt(en) att kopieras istället för att flyttas.
  • Nedtryckning av ALT kommer att skapa en kopia, även om kopieringsknappen är av.
  • Om ALT är nedtryckt, så kan du göra multipla kopior ända tills ALT släpps.

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)