Draft Array: Difference between revisions

From FreeCAD Documentation
mNo edit summary
(<translate>)
Line 1: Line 1:
<translate>
{{GuiCommand|Name=Draft_Array|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft -> Array}}
{{GuiCommand|Name=Draft_Array|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft -> Array}}


==Description==
==Description==

The Array tool creates an orthogonal (3-axes) or polar array from a selected object. If no object is selected, you will be invited to select one.
The Array tool creates an orthogonal (3-axes) or polar array from a selected object. If no object is selected, you will be invited to select one.


Line 8: Line 8:


==How to use==
==How to use==

# Select an object you wish to make an array with
# Select an object you wish to make an array with
# Press the {{KEY|[[Image:Draft Array.png|16px]] [[Draft Array]]}} button
# Press the {{KEY|[[Image:Draft Array.png|16px]] [[Draft Array]]}} button


==Options==
==Options==

* The array starts as orthogonal by default, you can then change its mode in the properties.
* The array starts as orthogonal by default, you can then change its mode in the properties.


==Properties==
==Properties==

* {{PropertyData|Array Type}}: Specifies the type of the array, ortho or polar
* {{PropertyData|Array Type}}: Specifies the type of the array, ortho or polar


For orthogonal arrays:
For orthogonal arrays:

* {{PropertyData|Interval X}}: The interval between each copy on the first axis
* {{PropertyData|Interval X}}: The interval between each copy on the first axis
* {{PropertyData|Interval Y}}: The interval between each copy on the second axis
* {{PropertyData|Interval Y}}: The interval between each copy on the second axis
Line 30: Line 26:


For polar arrays:
For polar arrays:

* {{PropertyData|Axis}}: The normal direction of the array circle
* {{PropertyData|Axis}}: The normal direction of the array circle
* {{PropertyData|Center}}: The center point of the array
* {{PropertyData|Center}}: The center point of the array
Line 37: Line 32:


==Scripting==
==Scripting==

The Array tool can by used in [[macros]] and from the python console by using one of the following functions.
The Array tool can by used in [[macros]] and from the python console by using one of the following functions.


For rectangular array:
'''array (objectslist,xvector,yvector,xnum,ynum,[zvector,znum])''' for rectangular array, or
</translate>
'''array (objectslist,center,totalangle,totalnum)''' for polar array: Creates an array of the
<syntaxhighlight>
objects contained in list (that can be an object or a list of objects) with, in case
array (objectslist,xvector,yvector,xnum,ynum,[zvector,znum])
of rectangular array, xnum of iterations in the x direction at xvector distance between iterations,
</syntaxhighlight>
and same for y direction with yvector and ynum. In case of polar array, center is a vector, totalangle
<translate>
is the angle to cover (in degrees) and totalnum is the number of objects, including the original.
For polar array:
</translate>
This function produces standalone copies of the base object(s)
<syntaxhighlight>
array (objectslist,center,totalangle,totalnum)
</syntaxhighlight>
<translate>
* Creates an array of the objects contained in list (that can be an object or a list of objects) with, in case of rectangular array, xnum of iterations in the x direction at xvector distance between iterations, and same for y direction with yvector and ynum. In case of polar array, center is a vector, totalangle is the angle to cover (in degrees) and totalnum is the number of objects, including the original.
* This function produces standalone copies of the base object(s)


Or
or


'''makeArray (object,xvector,yvector,xnum,ynum)''' for rectangular array, or
For rectangular array:
</translate>
'''makeArray (object,center,totalangle,totalnum)''' for polar array: Creates an array
<syntaxhighlight>
of the given object
makeArray (object,xvector,yvector,xnum,ynum)
with, in case of rectangular array, xnum of iterations in the x direction
</syntaxhighlight>
at xvector distance between iterations, and same for y direction with yvector
<translate>
and ynum. In case of polar array, center is a vector, totalangle is the angle
For polar array:
to cover (in degrees) and totalnum is the number of objects, including the original.
</translate>
<syntaxhighlight>
The result of this function is a parametric Draft Array object.
makeArray (object,center,totalangle,totalnum)
</syntaxhighlight>
<translate>
* Creates an array of the given object with, in case of rectangular array, xnum of iterations in the x direction at xvector distance between iterations, and same for y direction with yvector and ynum. In case of polar array, center is a vector, totalangle is the angle to cover (in degrees) and totalnum is the number of objects, including the original.
* The result of this function is a parametric Draft Array object.


Example:
Example:
</translate>

<syntaxhighlight>
import FreeCAD,Draft
import FreeCAD,Draft
Draft.array(FreeCAD.ActiveDocument.ActiveObject,FreeCAD.Vector(2,0,0),FreeCAD.Vector(0,2,0),2,2)
Draft.array(FreeCAD.ActiveDocument.ActiveObject,FreeCAD.Vector(2,0,0),FreeCAD.Vector(0,2,0),2,2)


</syntaxhighlight>
{{languages | {{es|Draft_Array/es}} {{fr|Draft_Array/fr}} {{it|Draft_Array/it}} }}
{{clear}}
<languages/>

Revision as of 15:55, 16 February 2014

Draft_Array

Menu location
Draft -> Array
Workbenches
Draft, Arch
Default shortcut
None
Introduced in version
-
See also
None

Description

The Array tool creates an orthogonal (3-axes) or polar array from a selected object. If no object is selected, you will be invited to select one.

How to use

  1. Select an object you wish to make an array with
  2. Press the Draft Array button

Options

  • The array starts as orthogonal by default, you can then change its mode in the properties.

Properties

  • DataArray Type: Specifies the type of the array, ortho or polar

For orthogonal arrays:

  • DataInterval X: The interval between each copy on the first axis
  • DataInterval Y: The interval between each copy on the second axis
  • DataInterval Z: The interval between each copy on the third axis
  • DataNumber X: The number of copies on the first axis
  • DataNumber Y: The number of copies on the second axis
  • DataNumber Z: The number of copies on the third axis

For polar arrays:

  • DataAxis: The normal direction of the array circle
  • DataCenter: The center point of the array
  • DataAngle: The angle to cover with copies
  • DataNumber Polar: The number of copies

Scripting

The Array tool can by used in macros and from the python console by using one of the following functions.

For rectangular array:

 array (objectslist,xvector,yvector,xnum,ynum,[zvector,znum])

For polar array:

 array (objectslist,center,totalangle,totalnum)
  • Creates an array of the objects contained in list (that can be an object or a list of objects) with, in case of rectangular array, xnum of iterations in the x direction at xvector distance between iterations, and same for y direction with yvector and ynum. In case of polar array, center is a vector, totalangle is the angle to cover (in degrees) and totalnum is the number of objects, including the original.
  • This function produces standalone copies of the base object(s)

Or

For rectangular array:

 makeArray (object,xvector,yvector,xnum,ynum)

For polar array:

 makeArray (object,center,totalangle,totalnum)
  • Creates an array of the given object with, in case of rectangular array, xnum of iterations in the x direction at xvector distance between iterations, and same for y direction with yvector and ynum. In case of polar array, center is a vector, totalangle is the angle to cover (in degrees) and totalnum is the number of objects, including the original.
  • The result of this function is a parametric Draft Array object.

Example:

 import FreeCAD,Draft
 Draft.array(FreeCAD.ActiveDocument.ActiveObject,FreeCAD.Vector(2,0,0),FreeCAD.Vector(0,2,0),2,2)