Draft Clone/pt-br: Difference between revisions

From FreeCAD Documentation
(Created page with "Draft Clone")
 
(Updating to match new version of source page)
 
(28 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Draft Clone|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft -> Clone|SeeAlso=[[Draft Scale|Draft Scale]]}}


<div class="mw-translate-fuzzy">
==Description==
{{Docnav
This tool produces a clone (a copy that is parametrically bound to the original object) of a selected object. If the original object changes, the clone changes too, but keeps its position, rotation and scale.
|[[Draft_Stretch/pt-br|Esticar]]
|[[Draft_OrthoArray/pt-br|Séries ortogonais]]
|[[Draft_Workbench/pt-br|Draft]]
|IconL=Draft_Stretch.svg
|IconR=Draft_OrthoArray.svg
|IconC=Workbench_Draft.svg
}}
</div>

<div class="mw-translate-fuzzy">
{{GuiCommand/pt-br
|Name=Draft Clone
|Name/pt-br=Draft Clone
|MenuLocation=Draft → Clone
|Workbenches=[[Draft_Workbench/pt-br|Draft]], [[Arch_Workbench/pt-br|Arch]]
|Shortcut={{KEY|C}} {{KEY|L}}
|SeeAlso=[[Draft Scale/pt-br|Draft Scale]]
}}
</div>

<span id="Description"></span>
==Descrição==

The [[Image:Draft_Clone.svg|24px]] '''Draft Clone''' command creates linked copies, clones, of selected objects. The shape of a clone is parametric, it will update if its source object changes. But a clone does have its own position, rotation, and scale, and its own [[Property_editor|View properties]]. For [[Arch_Workbench|Arch]] objects the command creates a special type of clone: an Arch clone.

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]]. Clones of 2D objects can be used in [[PartDesign_Body|PartDesign Bodies]].


[[Image:Draft_Clone_example.jpg|400px]]
[[Image:Draft_Clone_example.jpg|400px]]
{{Caption|Draft Clone next to its source object}}


<span id="Usage"></span>
==How to use==
==Utilização==
# Select objects you wish to clone
# Press the {{KEY|[[Image:Draft Clone.png|16px]] [[Draft Clone]]}} button


# Optionally select one or more objects.
==Properties==
# There are several ways to invoke the command:
* {{PropertyData|Scale}}: Specifies an optional scale factor for the clone
#* Press the {{Button|[[Image:Draft_Clone.svg|16px]] [[Draft_Clone|Clone]]}} button.
* The result of the [[Draft Scale]] tool is also a clone
#* Select the {{MenuCommand|Modification → [[Image:Draft_Clone.svg|16px]] Clone}} option from the menu.
#* Use the keyboard shortcut: {{KEY|C}} then {{KEY|L}}.
# If you have not yet selected an object: select an object in the [[3D_view|3D view]].

<span id="Properties"></span>
==Propriedades==

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

An object created with the Draft Clone command is derived from a [[Part_Part2DObject|Part Part2DObject]], a [[Part_Feature|Part Feature]] object or, if an Arch Clone is created, from the object type of the source object. It inherits all properties from that object. A clone derived from one of the first two objects also has the following additional properties:

===Data===

{{TitleProperty|Draft}}

* {{PropertyData|Fuse|Bool}}: specifies if overlapping shapes in the clone are fused or not.
* {{PropertyData|Objects|LinkListGlobal}}: specifies the objects that are cloned.
* {{PropertyData|Scale|Vector}}: specifies the X, Y and Z scale factors.


==Scripting==
==Scripting==
The Clone tool can by used in [[macros]] and from the python console by using the following function:


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

clone (obj,[delta])
To create a clone use the {{incode|make_clone}} method ({{Version|0.19}}) of the Draft module. This method replaces the deprecated {{incode|clone}} method.
</syntaxhighlight>

* Makes a clone of the given object(s).
{{Code|code=
* The clone is an exact, linked copy of the given object.
cloned_object = make_clone(obj, delta=None, forcedraft=False)
* If the original object changes, the final object changes too. Optionally, you can give a delta Vector to move the clone away from the original position.
}}

* {{incode|obj}} contains the objects to be cloned. It is either a single object or a list of objects.
* {{incode|delta}} is the displacement vector to be applied to the clone.
* If {{incode|forcedraft}} is {{incode|False}} and {{incode|obj}} contains a single [[Arch_Workbench|Arch object]] an Arch Clone is created. Set {{incode|forcedraft}} to {{incode|True}} to create a Draft Clone instead.
* {{incode|cloned_object}} is returned with the clone object.


Example:
Example:
<syntaxhighlight>
import Draft
Draft.clone(FreeCAD.ActiveDocument.ActiveObject)


{{Code|code=
</syntaxhighlight>
import FreeCAD as App
{{clear}}
import Draft
<languages/>

doc = App.newDocument()

place = App.Placement(App.Vector(1000, 0, 0), App.Rotation())
polygon1 = Draft.make_polygon(3, 750)
polygon2 = Draft.make_polygon(5, 750, placement=place)

vector = App.Vector(2600, 500, 0)
cloned_object = Draft.clone([polygon1, polygon2], delta=vector)

cloned_object.Fuse = True

doc.recompute()
}}


<div class="mw-translate-fuzzy">
{{Docnav
|[[Draft_Stretch/pt-br|Esticar]]
|[[Draft_OrthoArray/pt-br|Séries ortogonais]]
|[[Draft_Workbench/pt-br|Draft]]
|IconL=Draft_Stretch.svg
|IconR=Draft_OrthoArray.svg
|IconC=Workbench_Draft.svg
}}
</div>

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

Latest revision as of 19:47, 7 December 2023

Draft Clone

Veja também
Draft → Clone
Bancadas de trabalho
Draft, Arch
Atalho padrão
C L
Introduzido na versão
-
Veja também
Draft Scale

Descrição

The Draft Clone command creates linked copies, clones, of selected objects. The shape of a clone is parametric, it will update if its source object changes. But a clone does have its own position, rotation, and scale, and its own View properties. For Arch objects the command creates a special type of clone: an Arch clone.

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. Clones of 2D objects can be used in PartDesign Bodies.

Draft Clone next to its source object

Utilização

  1. Optionally select one or more objects.
  2. There are several ways to invoke the command:
    • Press the Clone button.
    • Select the Modification → Clone option from the menu.
    • Use the keyboard shortcut: C then L.
  3. If you have not yet selected an object: select an object in the 3D view.

Propriedades

See also: Property editor.

An object created with the Draft Clone command is derived from a Part Part2DObject, a Part Feature object or, if an Arch Clone is created, from the object type of the source object. It inherits all properties from that object. A clone derived from one of the first two objects also has the following additional properties:

Data

Draft

  • DadosFuse (Bool): specifies if overlapping shapes in the clone are fused or not.
  • DadosObjects (LinkListGlobal): specifies the objects that are cloned.
  • DadosScale (Vector): specifies the X, Y and Z scale factors.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To create a clone use the make_clone method (introduced in version 0.19) of the Draft module. This method replaces the deprecated clone method.

cloned_object = make_clone(obj, delta=None, forcedraft=False)
  • obj contains the objects to be cloned. It is either a single object or a list of objects.
  • delta is the displacement vector to be applied to the clone.
  • If forcedraft is False and obj contains a single Arch object an Arch Clone is created. Set forcedraft to True to create a Draft Clone instead.
  • cloned_object is returned with the clone object.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

place = App.Placement(App.Vector(1000, 0, 0), App.Rotation())
polygon1 = Draft.make_polygon(3, 750)
polygon2 = Draft.make_polygon(5, 750, placement=place)

vector = App.Vector(2600, 500, 0)
cloned_object = Draft.clone([polygon1, polygon2], delta=vector)

cloned_object.Fuse = True

doc.recompute()