ArrayRectangular Question

ArrayRectangular Question

Anonymous
Not applicable
496 Views
4 Replies
Message 1 of 5

ArrayRectangular Question

Anonymous
Not applicable
There is probably a very easy solution to what I ask. But what I want is to give each object created from the array a unique name so I may manipulate them individually later in the code.
Example: If I array a polyline to create 5 new polyline's, then how would I later set each one to a different layer or say move just one to a new location.
Thanks in advance, Ken
0 Likes
497 Views
4 Replies
Replies (4)
Message 2 of 5

mdhutchinson
Advisor
Advisor
not a guru here unless you speak of VLisp...
But I think a Collection may be the contruct for you... take a look at the "depends on purpose - Collection or Array?" post that I started.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Such a unique name already exists: its the handle of an object.

Each time you create a new polyline, get its handle, and store it in a way
that suits your needs, for example in a collection.

Gilles Plante

wrote in message news:[email protected]...
There is probably a very easy solution to what I ask. But what I want is to
give each object created from the array a unique name so I may manipulate
them individually later in the code.
Example: If I array a polyline to create 5 new polyline's, then how would I
later set each one to a different layer or say move just one to a new
location.
Thanks in advance, Ken
0 Likes
Message 4 of 5

Anonymous
Not applicable
Gilles, Could you give me an example?

If I create an array as such...

Solids = solid.arrayrectangular(1,5,1,1,12,1)

I'm creating 4 new solids, I am confused at how I can grab a certain one and change it's name/handle.
0 Likes
Message 5 of 5

Anonymous
Not applicable
From Developper Help:

RetVal = object.ArrayRectangular (NumberOfRows, NumberOfColumns,
NumberOfLevels, DistBetweenRows, DistBetweenColumns, DistBetweenLevels)

...

RetVal Variant Array (array of objects) The array of newly created
objects.

ArrayRectangular returns a reference to each object that has been created.
If you call ArrayRectangular more than one times, then change RetVal
variable so you can keep all of the returned arrays.

You can't change the handle - and why would you do so ? The handle is
automatically assigned when the object is created, and is permanent. The
handle is a way to "get" an object if it is the only "hint" you have. You
already have an array you may scan to get a particular object. You may also
create an arry or collection of your own if it suits better your need.

Gilles Plante


wrote in message news:[email protected]...
Gilles, Could you give me an example?

If I create an array as such...

Solids = solid.arrayrectangular(1,5,1,1,12,1)

I'm creating 4 new solids, I am confused at how I can grab a certain one and
change it's name/handle.
0 Likes