Draft Array/en: Difference between revisions
No edit summary |
(Importing a new version from external source) |
||
Line 9: | Line 9: | ||
# 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 |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
* {{PropertyData|Interval Y}}: The interval between each copy on the second axis |
|||
* {{PropertyData|Interval Z}}: The interval between each copy on the third axis |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
* {{PropertyData|Axis}}: The normal direction of the array circle |
|||
* {{PropertyData|Center}}: The center point of the array |
|||
* {{PropertyData|Angle}}: The angle to cover with copies |
|||
* {{PropertyData|Number Polar}}: The number of copies |
|||
==Scripting== |
==Scripting== |
||
The Array tool can by used in [[macros]] and from the python console by using one of the following functions, depending if you wish to obtain simple, standalone copies of your base object, or a parametric array object, that stays linked to the original object. |
The Array tool can by used in [[macros]] and from the python console by using one of the following functions, depending if you wish to obtain simple, standalone copies of your base object, or a parametric array object, that stays linked to the original object. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
{{Code|code= |
{{Code|code= |
||
array (objectslist,xvector,yvector,xnum,ynum,[zvector,znum]) |
array (objectslist,xvector,yvector,xnum,ynum,[zvector,znum]) |
||
}} |
}} |
||
⚫ | |||
For polar array: |
|||
⚫ | |||
{{Code|code= |
{{Code|code= |
||
array (objectslist,center,totalangle,totalnum) |
array (objectslist,center,totalangle,totalnum) |
||
Line 45: | Line 26: | ||
* This function produces standalone copies of the base object(s) |
* This function produces standalone copies of the base object(s) |
||
⚫ | |||
=== Parametric array === |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
For rectangular array: |
For rectangular array: |
||
Line 51: | Line 36: | ||
makeArray (object,xvector,yvector,xnum,ynum) |
makeArray (object,xvector,yvector,xnum,ynum) |
||
}} |
}} |
||
==Scripting== |
|||
For polar array: |
|||
The Array tool can by used in [[macros]] and from the python console by using one of the following functions, depending if you wish to obtain simple, standalone copies of your base object, or a parametric array object, that stays linked to the original object. |
|||
{{Code|code= |
{{Code|code= |
||
makeArray (object,center,totalangle,totalnum) |
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: |
|||
{{Code|code= |
{{Code|code= |
||
import FreeCAD,Draft |
import FreeCAD,Draft |
Revision as of 16:52, 2 February 2017
Draft Array |
Menu location |
---|
Draft → Array |
Workbenches |
Draft, Arch |
Default shortcut |
None |
Introduced in version |
- |
See also |
PathArray |
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
- Select an object you wish to make an array with
- Press the Draft Array button
Scripting
The Array tool can by used in macros and from the python console by using one of the following functions, depending if you wish to obtain simple, standalone copies of your base object, or a parametric array object, that stays linked to the original object.
Options
- The array starts as orthogonal by default, you can then change its mode in the properties.
array (objectslist,xvector,yvector,xnum,ynum,[zvector,znum])
Properties
- DataArray Type: Specifies the type of the array, ortho or polar
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)
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
For rectangular array:
makeArray (object,xvector,yvector,xnum,ynum)
Scripting
The Array tool can by used in macros and from the python console by using one of the following functions, depending if you wish to obtain simple, standalone copies of your base object, or a parametric array object, that stays linked to the original object.
makeArray (object,center,totalangle,totalnum)
Simple array
For rectangular array:
For polar array:
import FreeCAD,Draft
Draft.array(FreeCAD.ActiveDocument.ActiveObject,FreeCAD.Vector(2,0,0),FreeCAD.Vector(0,2,0),2,2)