Creates a 2D or 3D
rectangular array of objects.
Signature
VBA : RetVal =
object.ArrayRectangular (NumberOfRows, NumberOfColumns, NumberOfLevels,
DistBetweenRows, DistBetweenColumns, DistBetweenLevels)
VL : RetVal = (vlaArrayRectangular
object NumberOfRows NumberOfColumns NumberOfLevels DistBetweenRows
DistBetweenColumns DistBetweenLevels)
(vlaArrayRectangular obj therows
thecols thelevels drows dcols dlevels)

Object : All
Drawing Objects
The object or objects this method applies to.

NumberOfRows :
Integer; inputonly
The number of rows in the rectangular array. This must be a positive
number. If this number is 1, then NumberOfColumns must be greater
than 1.

NumberOfColumns :
Integer; inputonly
The number of columns in the rectangular array. This must be a
positive number. If this number is 1, then NumberOfRows must be
greater than 1.

NumberOfLevels :
Integer; inputonly
The number of levels in a 3D array.

DistBetweenRows :
Double; inputonly
The distance between the rows. If the distance between rows is a
positive number, rows are added upward from the base entity. If the
distance is a negative number, rows are added downward.

DistBetweenColumns
: Double; inputonly
The distance between the columns. If the distance between columns is
a positive number, columns are added to the right of the base
entity. If the distance is a negative number, columns are added to
the left.

DistBetweenLevels
: Double; inputonly
The distance between the array levels. If the distance between
levels is a positive number, levels are added in the positive
direction from the base entity. If the distance is a negative
number, levels are added in the negative direction.

RetVal : Variant
Array (array of objects)
The array of newly created objects.
Remarks
For a 2D array, specify
the NumberOfRows, NumberOfColumns, DistBetweenRow, and
DistBetweenColumns. For creating a 3D array, specify the NumberOfLevels
and DistBetweenLevels as well.
A rectangular array is
constructed by replicating the object in the selection set the
appropriate number of times. If you define one row, you must specify
more than one column and vice versa.
The object in the
selection set is assumed to be in the lower lefthand corner, and the
array is generated up and to the right. If the distance between rows is
a negative number, rows are added downward. If the distance between
columns is a negative number, the columns are added to the left.
AutoCAD builds the
rectangular array along a baseline defined by the current snap rotation
angle. This angle is zero by default, so the rows and columns of a
rectangular array are orthogonal with respect to the X and Y
drawing axes. You can change this angle and create a rotated array by
setting the snap rotation angle to a nonzero value. To do this, use the
SnapRotationAngle property.
NOTE!
You cannot execute this method while simultaneously iterating through a
collection. An iteration will open the work space for a readonly
operation, while this method attempts to perform a readwrite operation.
Complete any iteration before you call this method.
AttributeReference:
You should not attempt to use this method on AttributeReference objects.
AttributeReference objects inherit this method because they are one of
the drawing objects, however, it is not feasible to perform this
operation on an attribute reference.
Example :
(defun c:alarrayrectangular ()
(vlloadcom)
(setq util (vlagetutility
(vlagetactivedocument
(vlaxgetacadobject))))
(vlagetentity util 'obj 'ip "\nSelect Object: ")
(setq therows (vlaGetInteger util
"\nEnter the number of rows (): "))
(setq thecols (vlaGetInteger util
"\nEnter the number of columns (): "))
(setq thelevels (vlaGetInteger util
"\nEnter the number of levels: "))
(setq drows (vlaGetReal util
"\nEnter the distance between rows (): "))
(setq dcols (vlaGetReal util
"\nSpecify the distance between columns (): "))
(setq dlevels (vlaGetReal util
"\nSpecify the distance between levels: "))
(setq thearray (vlaArrayRectangular obj therows thecols
thelevels drows dcols dlevels))
(princ)
);defun

