Draft OrthoArray: Difference between revisions
(Added property types to the properties) |
(Removed Preferences paragraph.) |
||
(109 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
<translate> |
<translate> |
||
<!--T:1--> |
<!--T:1--> |
||
{{Docnav |
{{Docnav |
||
|[[Draft_Clone|Clone]] |
|||
|[[Draft_Draft2Sketch|Draft to Sketch]] |
|||
|[[Draft_PolarArray|PolarArray]] |
|||
|[[Draft_LinkArray|Link Array]] |
|||
|[[ |
|[[Draft_Workbench|Draft]] |
||
|IconL= |
|IconL=Draft_Clone.svg |
||
|IconR=Draft_PolarArray.svg |
|||
|IconC=Workbench_Draft.svg |
|IconC=Workbench_Draft.svg |
||
|IconR=Draft_LinkArray.svg |
|||
}} |
}} |
||
Line 15: | Line 16: | ||
|Name=Draft OrthoArray |
|Name=Draft OrthoArray |
||
|MenuLocation=Modification → Array tools → Array |
|MenuLocation=Modification → Array tools → Array |
||
|Workbenches=[[ |
|Workbenches=[[Draft_Workbench|Draft]], [[Arch_Workbench|Arch]] |
||
|Version=0.19 |
|Version=0.19 |
||
|SeeAlso=[[Draft_PolarArray|PolarArray]], [[Draft_CircularArray|CircularArray]], [[Draft_PathArray|PathArray]], [[Draft_PointArray|PointArray]], [[ |
|SeeAlso=[[Draft_PolarArray|Draft PolarArray]], [[Draft_CircularArray|Draft CircularArray]], [[Draft_PathArray|Draft PathArray]], [[Draft_PathLinkArray|Draft PathLinkArray]], [[Draft_PointArray|Draft PointArray]], [[Draft_PointLinkArray|Draft PointLinkArray]] |
||
}} |
}} |
||
Line 23: | Line 24: | ||
<!--T:4--> |
<!--T:4--> |
||
The |
The [[Image:Draft_OrthoArray.svg|24px]] '''Draft OrthoArray''' command creates an orthogonal (3-axes) array from a selected object. The command can optionally create a [[App_Link|Link]] array, which is more efficient than a regular array. |
||
<!--T:5--> |
<!--T:5--> |
||
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]]. |
|||
<!--T:6--> |
|||
* To create polar and circular arrays directly, use the corresponding {{Button|[[File:Draft_PolarArray.svg|16px]] [[Draft_PolarArray|PolarArray]]}} and {{Button|[[File:Draft_CircularArray.svg|16px]] [[Draft_CircularArray|CircularArray]]}} tools |
|||
* To position copies along a path use {{Button|[[File:Draft_PathArray.svg|16px]] [[Draft_PathArray|PathArray]]}} |
|||
* To position copies at specified points use {{Button|[[File:Draft_PointArray.svg|16px]] [[Draft_PointArray|PointArray]]}} |
|||
* To create copies or clones, and manually place them use {{Button|[[File:Draft_Move.svg|16px]] [[Draft_Move|Move]]}}, {{Button|[[File:Draft_Rotate.svg|16px]] [[Draft_Rotate|Rotate]]}}, and {{Button|[[File:Draft_Clone.svg|16px]] [[Draft_Clone|Clone]]}}. |
|||
<!--T:7--> |
|||
This command deprecates the previously existing {{Button|[[File:Draft_Array.svg|16px]] [[Draft_Array|Array]]}}, as well as the short lived, {{Button|[[File:Draft_LinkArray.svg|16px]][[Draft_LinkArray|LinkArray]]}} tools. |
|||
</translate> |
</translate> |
||
[[File:Draft_Array_example.png| |
[[File:Draft_Array_example.png|300px]] |
||
<translate> |
<translate> |
||
<!--T:8--> |
<!--T:8--> |
||
{{Caption| |
{{Caption|Draft OrthoArray}} |
||
==Usage== <!--T:9--> |
==Usage== <!--T:9--> |
||
<!--T:10--> |
<!--T:10--> |
||
# Optionally select one object. |
|||
# Select an object with which you wish to make an array. |
|||
# There are several ways to invoke the command: |
|||
# Press the {{Button|[[File:Draft_OrthoArray.svg|16px]] [[Draft_OrthoArray|Draft OrthoArray]]}} button. If no object is selected, you will be invited to select one. |
|||
#* Press the {{Button|[[Image:Draft_OrthoArray.svg|16px]] [[Draft_OrthoArray|Array]]}} button. |
|||
# The [[task_panel|task panel]] is launched, where you can select the number of elements in each X, Y, Z direction; and the interval between each created element. |
|||
#* Select the {{MenuCommand|Modification → Array tools → [[Image:Draft_OrthoArray.svg|16px]] Array}} option from the menu. |
|||
# Press {{Button|OK}} to complete the operation. |
|||
# The {{MenuCommand|Orthogonal array}} task panel opens. See [[#Options|Options]] for more information. |
|||
# If you have not yet selected an object: select one object. |
|||
<!--T:11--> |
|||
# Enter the required parameters in the task panel. |
|||
Once the array in created, you can select it in the [[tree_view|tree view]], so you can change its properties in the [[property_editor|property editor]], including changing the number of the elements, or even changing its type to "polar" or "circular". |
|||
# To finish the command do one of the following: |
|||
#* Click in the [[3D_view|3D view]]. |
|||
<!--T:12--> |
|||
#* Press {{KEY|Enter}}. |
|||
Each element in the array is an exact clone of the original object, but the entire array is considered a single unit in terms of properties and appearance. |
|||
#* Press the {{Button|OK}} button. |
|||
== Options == <!--T:13--> |
== Options == <!--T:13--> |
||
<!--T:14--> |
<!--T:14--> |
||
* |
* Enter the {{MenuCommand|Number of elements}} for the X, Y and Z directions. This number must be at least {{Value|1}} for every direction. |
||
* |
* Enter the {{MenuCommand|X intervals}} to specify the displacement for the elements in the X direction. For a rectangular array the Y and Z values must be {{Value|0}}. |
||
* |
* Enter the {{MenuCommand|Y intervals}} to specify the displacement for the elements in the Y direction. For a rectangular array the X and Z values must be {{Value|0}}. |
||
* |
* Enter the {{MenuCommand|Z intervals}} to specify the displacement for the elements in the Z direction. For a rectangular array the X and Y values must be {{Value|0}}. |
||
* Press the {{MenuCommand|Reset X, Y or Z}} button to reset the displacement in the given direction to the default values. |
|||
* Fuse: if it is checked, the resulting objects in the array will fuse together if they touch each other. This only works if "Link array" is unchecked. |
|||
* If the {{MenuCommand|Fuse}} checkbox is checked overlapping elements in the array are fused. This does not work for Link arrays. |
|||
* Link array: if it is checked, the resulting array will be a "Link array". This array internally uses [[App_Link|App Link]] objects, so it is more efficient when handling many copies of complex shapes. However, in this case, the objects cannot be fused together. |
|||
* If the {{MenuCommand|Link array}} checkbox is checked a Link array instead of a regular array is created. A Link array is more efficient because its elements are [[App_Link|App Link]] objects. |
|||
* Press {{KEY|Esc}} or the {{Button|Cancel}} button to abort the command. |
|||
<!--T: |
==Notes== <!--T:65--> |
||
{{Emphasis|Note:}} if a Link array is created, this object cannot be converted to a regular array. And similarly, a regular array cannot be converted to a Link array. Therefore, you must choose the type of array that you want at creation time. |
|||
<!--T:12--> |
|||
* A Draft OrthoArray can be turned into a [[Draft_PolarArray|Draft PolarArray]] or a [[Draft_CircularArray|Draft CircularArray]] by changing its {{PropertyData|Array Type}} property. |
|||
* A Link array cannot be turned into a regular array or vice versa. The type of array must be decided at creation time. |
|||
== Properties == <!--T:16--> |
== Properties == <!--T:16--> |
||
<!--T:69--> |
|||
{{TitleProperty|Draft}} |
|||
See also: [[property_editor|Property editor]]. |
|||
For all types of arrays: |
|||
<!--T:50--> |
|||
The Draft OrthoArray command, the [[Draft_PolarArray|Draft PolarArray command]] and the [[Draft_CircularArray|Draft CircularArray command]] create the same object. This object is derived from a [[Part_Feature|Part Feature]] object and inherits all its properties (with the exception of some View properties that are not inherited by Link arrays). The following properties are additional unless otherwise stated: |
|||
===Data=== <!--T:70--> |
|||
<!--T:64--> |
|||
{{TitleProperty|Link}} |
|||
<!--T:71--> |
|||
The properties in this group are only available for Link arrays. See [[Std_LinkMake#Properties|Std LinkMake]] for more information. |
|||
<!--T:47--> |
|||
* {{PropertyData|Scale|Float}} |
|||
* {{PropertyData|Scale Vector|Vector|Hidden}} |
|||
* {{PropertyData|Scale List|VectorList}} |
|||
* {{PropertyData|Visibility List|BoolList|Hidden}} |
|||
* {{PropertyData|Placement List|PlacementList|Hidden}} |
|||
* {{PropertyData|Element List|LinkList|Hidden}} |
|||
* {{PropertyData|_ Link Touched|Bool|Hidden}} |
|||
* {{PropertyData|_ Child Cache|LinkList|Hidden}} |
|||
* {{PropertyData|Colored Elements|LinkSubHidden|Hidden}} |
|||
* {{PropertyData|Link Transform|Bool}} |
|||
<!--T:62--> |
|||
{{TitleProperty|Circular array}} |
|||
<!--T:72--> |
|||
The properties in this group are hidden for orthogonal arrays and polar arrays. |
|||
<!--T:20--> |
|||
* {{PropertyData|Number Circles|Integer}}: specifies the number of circular layers. Must be at least {{Value|2}}. |
|||
* {{PropertyData|Radial Distance|Distance}}: specifies the distance between circular layers. |
|||
* {{PropertyData|Symmetry|Integer}}: specifies the number of symmetry lines. This number changes the distribution of the elements in the array. |
|||
* {{PropertyData|Tangential Distance|Distance}}: specifies the distance between elements in the same circular layer. Must be larger than zero. |
|||
<!--T:58--> |
|||
{{TitleProperty|Objects}} |
|||
<!--T:17--> |
<!--T:17--> |
||
* {{PropertyData|Array Type|Enumeration}}: specifies the type of array |
* {{PropertyData|Array Type|Enumeration}}: specifies the type of array, which can be {{value|ortho}}, {{value|polar}} or {{value|circular}}. |
||
* {{PropertyData|Axis Reference|LinkGlobal}}: specifies the object and edge to be used instead of the {{PropertyData|Axis}} and {{PropertyData|Center}} properties. Not used for orthogonal arrays. |
|||
* {{PropertyData|Base|Link}}: specifies the object to duplicate in the array. |
* {{PropertyData|Base|Link}}: specifies the object to duplicate in the array. |
||
* {{PropertyData|Count|Integer}}: (read-only) specifies the total number of elements in the array. {{VersionMinus|0.20}}: Only available for Link arrays. |
|||
* {{PropertyData|Fuse|Bool}}: it defaults to {{FALSE}}; if it is {{TRUE}}, and the copies intersect with each other, they will be fused together into a single shape. This only works if the initial array was not a "Link array". |
|||
* {{PropertyData|Expand Array|Bool}}: specifies whether to expand the array in the [[Tree_view|Tree view]] to enable the selection of its individual elements. Only available for Link arrays. |
|||
* {{PropertyData|Fuse|Bool}}: specifies if overlapping elements in the array are fused or not. Not used for Link arrays. |
|||
<!--T:59--> |
|||
{{TitleProperty|Orthogonal array}} |
|||
<!--T:73--> |
|||
The properties in this group are hidden for circular arrays and polar arrays. |
|||
<!--T:18--> |
<!--T:18--> |
||
* {{PropertyData|Interval X|VectorDistance}}: specifies the interval between elements in the X direction. |
|||
For orthogonal arrays: |
|||
* {{PropertyData|Interval |
* {{PropertyData|Interval Y|VectorDistance}}: specifies the interval between elements in the Y direction. |
||
* {{PropertyData|Interval |
* {{PropertyData|Interval Z|VectorDistance}}: specifies the interval between elements in the Z direction. |
||
* {{PropertyData| |
* {{PropertyData|Number X|Integer}}: specifies the number of elements in the X direction. Must be at least {{Value|1}}. |
||
* {{PropertyData|Number |
* {{PropertyData|Number Y|Integer}}: specifies the number of elements in the Y direction. Must be at least {{Value|1}}. |
||
* {{PropertyData|Number |
* {{PropertyData|Number Z|Integer}}: specifies the number of elements in the Z direction. Must be at least {{Value|1}}. |
||
* {{PropertyData|Number Z|Integer}}: specifies the number of copies on the Z axis. |
|||
<!--T: |
<!--T:61--> |
||
{{TitleProperty|Polar array}} |
|||
For polar arrays: |
|||
* {{PropertyData|Angle|Angle}}: specifies the aperture of the circular arc to cover with copies; use 360 to cover an entire circle. |
|||
* {{PropertyData|Axis|Vector}}: specifies the normal direction of the array circle. |
|||
* {{PropertyData|Center|VectorDistance}}: specifies the center point of the array circle. |
|||
* {{PropertyData|Interval Axis|VectorDistance}}: specifies the interval between each copy on the {{PropertyData|Axis}} direction. |
|||
* {{PropertyData|Number Polar|Integer}}: specifies the number of copies to place in the circular arrangement. |
|||
<!--T: |
<!--T:74--> |
||
The properties in this group are hidden for circular arrays and orthogonal arrays. |
|||
For circular arrays: |
|||
* {{PropertyData|Number Circles|Integer}}: the number of circular layers to create. It must be at least one. |
|||
* {{PropertyData|Radial distance|Distance}}: the distance from one element in a circular layer to the next element in another layer. |
|||
* {{PropertyData|Symmetry|Integer}}: a number that indicates the symmetry lines in the circular layers. This number changes the distribution of the objects and making it very large may eliminate the central layers of copies. |
|||
* {{PropertyData|Tangential Distance|Distance}}: the distance from one element in a circular layer to the next element in the same layer. |
|||
<!--T:19--> |
|||
=== Link arrays === |
|||
* {{PropertyData|Angle|Angle}}: specifies the aperture of the circular arc. Use {{value|360°}} for a full circle. |
|||
* {{PropertyData|Interval Axis|VectorDistance}}: specifies the interval between elements in the {{PropertyData|Axis}} direction. |
|||
* {{PropertyData|Number Polar|Integer}}: specifies the number of elements in the polar direction. |
|||
<!--T:60--> |
|||
In addition to the previous properties, these properties only appear when the array is originally created as a Link array. |
|||
{{TitleProperty|Polar/circular array}} |
|||
<!--T:75--> |
|||
{{TitleProperty|Draft}} |
|||
The properties in this group are hidden for orthogonal arrays. |
|||
<!--T:51--> |
|||
* {{PropertyData|Count|Integer}}: it is the total number of objects in the array including the original object. |
|||
* {{PropertyData| |
* {{PropertyData|Axis|Vector}}: specifies the direction of the axis of the array. |
||
* {{PropertyData|Center|VectorDistance}}: specifies the center point of the array. The axis of the array passes through this point. For circular arrays it is an offset from the {{PropertyData|Placement}} of the {{PropertyData|Base}} object. |
|||
===View=== <!--T:76--> |
|||
<!--T:77--> |
|||
{{TitleProperty|Link}} |
{{TitleProperty|Link}} |
||
<!--T:78--> |
|||
* {{PropertyData|Scale|Float}}: specifies the scale of the resulting array, as if it were a [[Draft_Clone|Clone]]. |
|||
The properties in this group, with the exception of the inherited property, are only available for Link arrays. See [[Std_LinkMake#Properties|Std LinkMake]] for more information. |
|||
* {{PropertyData|Link Transform|Bool}}: it defaults to {{FALSE}} if it is {{TRUE}}, will be able to be transformed. |
|||
<!--T:79--> |
|||
=== Notes === |
|||
* {{PropertyView|Draw Style|Enumeration}} |
|||
* {{PropertyView|Line Width|FloatConstraint}} |
|||
* {{PropertyView|Override Material|Bool}} |
|||
* {{PropertyView|Point Size|FloatConstraint}} |
|||
* {{PropertyView|Selectable|Bool}}: this is an inherited property that appears in the Selection group for other arrays |
|||
* {{PropertyView|Shape Material|Material}} |
|||
<!--T: |
<!--T:80--> |
||
{{TitleProperty|Base}} |
|||
The number property, either in X, Y, Z, polar, or circles, also includes the original object, so this number must be at least one. |
|||
<!--T:81--> |
|||
The properties in this group, with the exception of the inherited property, are only available for Link arrays. See [[Std_LinkMake#Properties|Std LinkMake]] for more information. |
|||
<!--T:82--> |
|||
* {{PropertyView|Child View Provider|PersistentObject|Hidden}} |
|||
* {{PropertyView|Material List|MaterialList|Hidden}} |
|||
* {{PropertyView|Override Color List|ColorList|Hidden}} |
|||
* {{PropertyView|Override Material List|BoolList|Hidden}} |
|||
* {{PropertyView|Proxy|PythonObject|Hidden}}: this is an inherited property. |
|||
<!--T:83--> |
|||
{{TitleProperty|Display Options}} |
|||
<!--T:84--> |
|||
The properties in this group are inherited properties. See [[Part_Feature#Properties|Part Feature]] for more information. |
|||
<!--T:85--> |
|||
* {{PropertyView|Bounding Box|Bool}}: this property is not inherited by Link arrays. |
|||
* {{PropertyView|Display Mode|Enumeration}}: for Link arrays it can be {{value|Link}} or {{value|ChildView}}. For other arrays it can be: {{value|Flat Lines}}, {{value|Shaded}}, {{value|Wireframe}} or {{value|Points}} |
|||
* {{PropertyView|Show In Tree|Bool}} |
|||
* {{PropertyView|Visibility|Bool}} |
|||
<!--T:86--> |
|||
{{TitleProperty|Draft}} |
|||
<!--T: |
<!--T:87--> |
||
* {{PropertyView|Pattern|Enumeration}}: not used. |
|||
An interval is not a simple distance, but a vector {{Value|(x, y, z)}}. If more than one value is non-zero, the copy will be created in the main direction, but will also be displaced in the other non-zero directions. |
|||
* {{PropertyView|Pattern Size|Float}}: not used. |
|||
<!--T: |
<!--T:88--> |
||
{{TitleProperty|Object style}} |
|||
For example, if {{PropertyData|Interval X}} is {{Value|(2 m, 1 m, 1 m)}}, and {{PropertyData|Number X}} is {{Value|3}}, it will create 3 copies in the X direction; the first copy will be at the original position, the second will be displaced 2 m on X, 1 m on Y, and 1 m on Z; the third copy will be displaced 4 m on X, 2 m on Y, and 2 m on Z. Each array element will be moved slightly to one side (Y direction) and up (Z direction) beside the main X direction. |
|||
<!--T: |
<!--T:89--> |
||
The properties in this group are not inherited by Link arrays. |
|||
The {{PropertyData|Interval Axis}} property works in the same way. If the original shape lies on the XY plane, creating a polar array with {{PropertyData|Interval Axis}} {{Value|(0, 0, z)}} allows you to make spiral arrangements. |
|||
==Scripting== <!--T:25--> |
==Scripting== <!--T:25--> |
||
<!--T:26--> |
<!--T:26--> |
||
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]]. |
|||
===Parametric array=== <!--T:90--> |
|||
<!--T:27--> |
<!--T:27--> |
||
To create a parametric orthogonal array use the {{incode|make_array}} method ({{Version|0.19}}) of the Draft module. This method replaces the deprecated {{incode|makeArray}} method. The {{incode|make_array}} method can create Draft OrthoArrays, [[Draft_PolarArray|Draft PolarArrays]] and [[Draft_CircularArray|Draft CircularArrays]]. For each array type one or more wrappers are available. |
|||
The Array tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using two different functions, depending on if you wish to obtain standalone copies of your base object, or a parametric array object that stays linked to the original object. |
|||
<!--T:91--> |
|||
The main method: |
|||
<!--T:29--> |
|||
The basic signature is as follows: |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
array = make_array(base_object, arg1, arg2, arg3, arg4=None, arg5=None, arg6=None, use_link=True) |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T: |
<!--T:92--> |
||
The wrappers for orthogonal arrays are: |
|||
To create a rectangular array, use it like this: |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
array = make_ortho_array(base_object, |
|||
array_list = array(objectslist, xvector, yvector, xnum, ynum) |
|||
v_x=App.Vector(10, 0, 0), v_y=App.Vector(0, 10, 0), v_z=App.Vector(0, 0, 10), |
|||
array_list = array(objectslist, xvector, yvector, zvector, xnum, ynum, znum) |
|||
n_x=2, n_y=2, n_z=1, |
|||
use_link=True) |
|||
}} |
}} |
||
<translate> |
|||
<!--T:31--> |
|||
To create a polar array, use it like this: |
|||
</translate> |
|||
{{Code|code= |
{{Code|code= |
||
array = make_ortho_array2d(base_object, |
|||
array_list = array(objectslist, center, totalangle, totalnum) |
|||
v_x=App.Vector(10, 0, 0), v_y=App.Vector(0, 10, 0), |
|||
n_x=2, n_y=2, |
|||
use_link=True) |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T: |
<!--T:93--> |
||
The wrappers for rectangular arrays are: |
|||
* Creates an array from the objects contained in {{incode|objectslist}}, which can be a single object or a list of objects. |
|||
* In case of a rectangular array, {{incode|xvector}}, {{incode|yvector}}, and {{incode|zvector}} determine the distance between the base points of each copy, in the X, Y, and Z directions; and {{incode|xnum}}, {{incode|ynum}}, and {{incode|znum}} are the number of copies in the respective direction. |
|||
* In case of a polar array, {{incode|center}} defines the center of the array circle, {{incode|totalangle}} is the angle of the arc in degrees to cover with copies, and {{incode|totalnum}} is the number of copies to arrange around the circle, including the original object. |
|||
* {{incode|array_list}} is returned with the new copies. |
|||
** {{incode|array_list}} is either a single object or a list of objects, depending on the input {{incode|objectslist}}. |
|||
<!--T:33--> |
|||
This function internally uses {{incode|Draft.move()}} and {{incode|Draft.rotate()}} with <code>copy=True</code>. |
|||
<!--T:34--> |
|||
Example: |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
array = make_rect_array(base_object, |
|||
import FreeCAD, Draft |
|||
d_x=10, d_y=10, d_z=10, |
|||
n_x=2, n_y=2, n_z=1, |
|||
Rect = Draft.makeRectangle(1500, 500) |
|||
use_link=True) |
|||
}} |
|||
{{Code|code= |
|||
array_list = Draft.array(Rect, FreeCAD.Vector(1600, 0, 0), FreeCAD.Vector(0, 600, 0), 3, 4) |
|||
array = make_rect_array2d(base_object, |
|||
d_x=10, d_y=10, |
|||
n_x=2, n_y=2, |
|||
use_link=True) |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:39--> |
|||
* {{incode|base_object}} is the object to be arrayed. It can also be the {{incode|Label}} (string) of an object in the current document. |
|||
* {{incode|v_x}}, {{incode|v_y}}, and {{incode|v_z}} are the vectors between the base points of the elements in the respective directions. |
|||
* {{incode|d_x}}, {{incode|d_y}}, and {{incode|d_z}} are the distances between the base points of the elements in the respective directions. |
|||
* {{incode|n_x}}, {{incode|n_y}}, and {{incode|n_z}} are the numbers of elements in the respective directions. |
|||
* If {{incode|use_link}} is {{incode|True}} the created elements are [[App_Link|App Links]] instead of regular copies. |
|||
* {{incode|array}} is returned with the created array object. |
|||
<!--T: |
<!--T:40--> |
||
Example: |
|||
The basic signature is as follows: |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import FreeCAD as App |
|||
Array = makeArray(baseobject, arg1, arg2, arg3, arg4=None, arg5=None, arg6=None, use_link=False) |
|||
import Draft |
|||
}} |
|||
<translate> |
|||
doc = App.newDocument() |
|||
<!--T:37--> |
|||
To create a rectangular array, use it like this: |
|||
rect = Draft.make_rectangle(1500, 500) |
|||
</translate> |
|||
v_x = App.Vector(1600, 0, 0) |
|||
{{Code|code= |
|||
v_y = App.Vector(0, 600, 0) |
|||
Array = makeArray(baseobject, xvector, yvector, xnum, ynum, use_link=False) |
|||
Array = makeArray(baseobject, xvector, yvector, zvector, xnum, ynum, znum, use_link=False) |
|||
array = Draft.make_ortho_array2d(rect, v_x, v_y, 3, 4) |
|||
doc.recompute() |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T: |
===Non-parametric array=== <!--T:94--> |
||
To create a polar array, use it like this: |
|||
<!--T:30--> |
|||
To create a non-parametric orthogonal array use the {{incode|array}} method of the Draft module. This method returns {{incode|None}}. |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
array(objectslist, xvector, yvector, xnum, ynum) |
|||
Array = makeArray(baseobject, center, totalangle, totalnum, use_link=False) |
|||
array(objectslist, xvector, yvector, zvector, xnum, ynum, znum) |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T: |
<!--T:34--> |
||
* Creates an {{incode|Array}} object from the given {{incode|baseobject}}. |
|||
* In case of a rectangular array, {{incode|xvector}}, {{incode|yvector}}, and {{incode|zvector}} determine the distance between the base points of each copy, in the X, Y, and Z directions; and {{incode|xnum}}, {{incode|ynum}}, and {{incode|znum}} are the number of copies in the respective direction. |
|||
* In case of a polar array, {{incode|center}} defines the center of the array circle, {{incode|totalangle}} is the angle of the arc in degrees to cover with copies, and {{incode|totalnum}} is the number of copies to arrange around the circle, including the original object. |
|||
* If {{incode|use_link}} is {{incode|True}} the resulting array will be a Link array, and will have additional properties. |
|||
<!--T:40--> |
|||
Example: |
Example: |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import FreeCAD |
import FreeCAD as App |
||
import Draft |
|||
doc = App.newDocument() |
|||
Rect = Draft.makeRectangle(1500, 500) |
|||
xvector = FreeCAD.Vector(1600, 0, 0) |
|||
yvector = FreeCAD.Vector(0, 600, 0) |
|||
Array = Draft.makeArray(Rect, xvector, yvector, 3, 4) |
|||
rect = Draft.make_rectangle(1500, 500) |
|||
v_x = App.Vector(1600, 0, 0) |
|||
v_y = App.Vector(0, 600, 0) |
|||
Draft.array(rect, v_x, v_y, 3, 4) |
|||
doc.recompute() |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:41--> |
<!--T:41--> |
||
{{Docnav |
{{Docnav |
||
|[[Draft_Clone|Clone]] |
|||
|[[Draft_Draft2Sketch|Draft to Sketch]] |
|||
|[[Draft_PolarArray|PolarArray]] |
|||
|[[Draft_LinkArray|Link Array]] |
|||
|[[ |
|[[Draft_Workbench|Draft]] |
||
|IconL= |
|IconL=Draft_Clone.svg |
||
|IconR=Draft_PolarArray.svg |
|||
|IconC=Workbench_Draft.svg |
|IconC=Workbench_Draft.svg |
||
|IconR=Draft_LinkArray.svg |
|||
}} |
}} |
||
Line 258: | Line 337: | ||
{{Draft Tools navi{{#translation:}}}} |
{{Draft Tools navi{{#translation:}}}} |
||
{{Userdocnavi{{#translation:}}}} |
{{Userdocnavi{{#translation:}}}} |
||
{{clear}} |
Latest revision as of 19:47, 7 December 2023
Draft OrthoArray |
Menu location |
---|
Modification → Array tools → Array |
Workbenches |
Draft, Arch |
Default shortcut |
None |
Introduced in version |
0.19 |
See also |
Draft PolarArray, Draft CircularArray, Draft PathArray, Draft PathLinkArray, Draft PointArray, Draft PointLinkArray |
Description
The Draft OrthoArray command creates an orthogonal (3-axes) array from a selected object. The command can optionally create a Link array, which is more efficient than a regular array.
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.
Draft OrthoArray
Usage
- Optionally select one object.
- There are several ways to invoke the command:
- Press the Array button.
- Select the Modification → Array tools → Array option from the menu.
- The Orthogonal array task panel opens. See Options for more information.
- If you have not yet selected an object: select one object.
- Enter the required parameters in the task panel.
- To finish the command do one of the following:
- Click in the 3D view.
- Press Enter.
- Press the OK button.
Options
- Enter the Number of elements for the X, Y and Z directions. This number must be at least
1
for every direction. - Enter the X intervals to specify the displacement for the elements in the X direction. For a rectangular array the Y and Z values must be
0
. - Enter the Y intervals to specify the displacement for the elements in the Y direction. For a rectangular array the X and Z values must be
0
. - Enter the Z intervals to specify the displacement for the elements in the Z direction. For a rectangular array the X and Y values must be
0
. - Press the Reset X, Y or Z button to reset the displacement in the given direction to the default values.
- If the Fuse checkbox is checked overlapping elements in the array are fused. This does not work for Link arrays.
- If the Link array checkbox is checked a Link array instead of a regular array is created. A Link array is more efficient because its elements are App Link objects.
- Press Esc or the Cancel button to abort the command.
Notes
- A Draft OrthoArray can be turned into a Draft PolarArray or a Draft CircularArray by changing its DataArray Type property.
- A Link array cannot be turned into a regular array or vice versa. The type of array must be decided at creation time.
Properties
See also: Property editor.
The Draft OrthoArray command, the Draft PolarArray command and the Draft CircularArray command create the same object. This object is derived from a Part Feature object and inherits all its properties (with the exception of some View properties that are not inherited by Link arrays). The following properties are additional unless otherwise stated:
Data
Link
The properties in this group are only available for Link arrays. See Std LinkMake for more information.
- DataScale (
Float
) - Data (Hidden)Scale Vector (
Vector
) - DataScale List (
VectorList
) - Data (Hidden)Visibility List (
BoolList
) - Data (Hidden)Placement List (
PlacementList
) - Data (Hidden)Element List (
LinkList
) - Data (Hidden)_ Link Touched (
Bool
) - Data (Hidden)_ Child Cache (
LinkList
) - Data (Hidden)Colored Elements (
LinkSubHidden
) - DataLink Transform (
Bool
)
Circular array
The properties in this group are hidden for orthogonal arrays and polar arrays.
- DataNumber Circles (
Integer
): specifies the number of circular layers. Must be at least2
. - DataRadial Distance (
Distance
): specifies the distance between circular layers. - DataSymmetry (
Integer
): specifies the number of symmetry lines. This number changes the distribution of the elements in the array. - DataTangential Distance (
Distance
): specifies the distance between elements in the same circular layer. Must be larger than zero.
Objects
- DataArray Type (
Enumeration
): specifies the type of array, which can beortho
,polar
orcircular
. - DataAxis Reference (
LinkGlobal
): specifies the object and edge to be used instead of the DataAxis and DataCenter properties. Not used for orthogonal arrays. - DataBase (
Link
): specifies the object to duplicate in the array. - DataCount (
Integer
): (read-only) specifies the total number of elements in the array. version 0.20 and below: Only available for Link arrays. - DataExpand Array (
Bool
): specifies whether to expand the array in the Tree view to enable the selection of its individual elements. Only available for Link arrays. - DataFuse (
Bool
): specifies if overlapping elements in the array are fused or not. Not used for Link arrays.
Orthogonal array
The properties in this group are hidden for circular arrays and polar arrays.
- DataInterval X (
VectorDistance
): specifies the interval between elements in the X direction. - DataInterval Y (
VectorDistance
): specifies the interval between elements in the Y direction. - DataInterval Z (
VectorDistance
): specifies the interval between elements in the Z direction. - DataNumber X (
Integer
): specifies the number of elements in the X direction. Must be at least1
. - DataNumber Y (
Integer
): specifies the number of elements in the Y direction. Must be at least1
. - DataNumber Z (
Integer
): specifies the number of elements in the Z direction. Must be at least1
.
Polar array
The properties in this group are hidden for circular arrays and orthogonal arrays.
- DataAngle (
Angle
): specifies the aperture of the circular arc. Use360°
for a full circle. - DataInterval Axis (
VectorDistance
): specifies the interval between elements in the DataAxis direction. - DataNumber Polar (
Integer
): specifies the number of elements in the polar direction.
Polar/circular array
The properties in this group are hidden for orthogonal arrays.
- DataAxis (
Vector
): specifies the direction of the axis of the array. - DataCenter (
VectorDistance
): specifies the center point of the array. The axis of the array passes through this point. For circular arrays it is an offset from the DataPlacement of the DataBase object.
View
Link
The properties in this group, with the exception of the inherited property, are only available for Link arrays. See Std LinkMake for more information.
- ViewDraw Style (
Enumeration
) - ViewLine Width (
FloatConstraint
) - ViewOverride Material (
Bool
) - ViewPoint Size (
FloatConstraint
) - ViewSelectable (
Bool
): this is an inherited property that appears in the Selection group for other arrays - ViewShape Material (
Material
)
Base
The properties in this group, with the exception of the inherited property, are only available for Link arrays. See Std LinkMake for more information.
- View (Hidden)Child View Provider (
PersistentObject
) - View (Hidden)Material List (
MaterialList
) - View (Hidden)Override Color List (
ColorList
) - View (Hidden)Override Material List (
BoolList
) - View (Hidden)Proxy (
PythonObject
): this is an inherited property.
Display Options
The properties in this group are inherited properties. See Part Feature for more information.
- ViewBounding Box (
Bool
): this property is not inherited by Link arrays. - ViewDisplay Mode (
Enumeration
): for Link arrays it can beLink
orChildView
. For other arrays it can be:Flat Lines
,Shaded
,Wireframe
orPoints
- ViewShow In Tree (
Bool
) - ViewVisibility (
Bool
)
Draft
- ViewPattern (
Enumeration
): not used. - ViewPattern Size (
Float
): not used.
Object style
The properties in this group are not inherited by Link arrays.
Scripting
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
Parametric array
To create a parametric orthogonal array use the make_array
method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makeArray
method. The make_array
method can create Draft OrthoArrays, Draft PolarArrays and Draft CircularArrays. For each array type one or more wrappers are available.
The main method:
array = make_array(base_object, arg1, arg2, arg3, arg4=None, arg5=None, arg6=None, use_link=True)
The wrappers for orthogonal arrays are:
array = make_ortho_array(base_object,
v_x=App.Vector(10, 0, 0), v_y=App.Vector(0, 10, 0), v_z=App.Vector(0, 0, 10),
n_x=2, n_y=2, n_z=1,
use_link=True)
array = make_ortho_array2d(base_object,
v_x=App.Vector(10, 0, 0), v_y=App.Vector(0, 10, 0),
n_x=2, n_y=2,
use_link=True)
The wrappers for rectangular arrays are:
array = make_rect_array(base_object,
d_x=10, d_y=10, d_z=10,
n_x=2, n_y=2, n_z=1,
use_link=True)
array = make_rect_array2d(base_object,
d_x=10, d_y=10,
n_x=2, n_y=2,
use_link=True)
base_object
is the object to be arrayed. It can also be theLabel
(string) of an object in the current document.v_x
,v_y
, andv_z
are the vectors between the base points of the elements in the respective directions.d_x
,d_y
, andd_z
are the distances between the base points of the elements in the respective directions.n_x
,n_y
, andn_z
are the numbers of elements in the respective directions.- If
use_link
isTrue
the created elements are App Links instead of regular copies. array
is returned with the created array object.
Example:
import FreeCAD as App
import Draft
doc = App.newDocument()
rect = Draft.make_rectangle(1500, 500)
v_x = App.Vector(1600, 0, 0)
v_y = App.Vector(0, 600, 0)
array = Draft.make_ortho_array2d(rect, v_x, v_y, 3, 4)
doc.recompute()
Non-parametric array
To create a non-parametric orthogonal array use the array
method of the Draft module. This method returns None
.
array(objectslist, xvector, yvector, xnum, ynum)
array(objectslist, xvector, yvector, zvector, xnum, ynum, znum)
Example:
import FreeCAD as App
import Draft
doc = App.newDocument()
rect = Draft.make_rectangle(1500, 500)
v_x = App.Vector(1600, 0, 0)
v_y = App.Vector(0, 600, 0)
Draft.array(rect, v_x, v_y, 3, 4)
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, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub