Does anyone have a good way to get the Column and Row Values of an array? Lisp, Vlisp?
No. of Columns
No. Of Rows
Spacing for each
Overall Spacing
AutoCAD 2012
Thanks.
Array is inside the block "ped_pln". It was created with the ARRAY command accessed from the Ribbon.
That information is in neither the Entity Data, Extended Data, nor the VLA Properties. The Entity Data has several Entity Names within it, of which neither the first nor the last has it, but I didn't check the others yet. Some of those also contain nested Entity Names. It's probably in the Entity Data for one of those nested or double- [or triple-?] nested Entity Names, but it could take some exploring to find it. I may dig deeper later, if someone else doesn't beat me to it.
My wild guess at your objective:
the X and Y valuse of coordinates,
of something created by the ARRAY command.
To me, there is no Array entity or object,
just the copies of some object generated by
the array command.
Your example may be circle entities,
generated by an array command,
for a rectangular bolt patter.
To get the coords of those objects,
you could simply select them,
and derive theri coords and segregate
to Xs and Ys, and then get their extremes,
or do whatever.
With more code, it could get them from INSERT objects,
or it could be more automated.
devitg wrote:
It is a block , with the 4 hole as a block , each hole as a block , and at last a circle
To make sure I specify my process correctly:
Circle was drawn in top, left corner. Then array pattern. Thrn the whole geometry set was blocked.
@stevor wrote:
.... To me, there is no Array entity or object, just the copies of some object generated by the array command. ....
That's also true for me where I have Acad2004, but in Acad2015 that I have elsewhere, the Array command combines the result into a single object [maybe there's an option whether to or not -- I'm not there to check right now]. I don't know in which version that came in.
Another way such a set of things could be done is using a Block, with the Minsert command, which makes a single object that's a rectangular array of Block insertions, all in one command. In that case, the number of rows and columns and their spacings are all right there in the Entity Data and VLA Properties, and can be accessed much more easily than in an Array object in newer versions.
devitg wrote:
If so please upload it as a true DWG , not as a block .
O.k. I did.
I don't mean to sound un-gratful, or disrepectful.......but I don't understand why it would matter.
FYI......The geometry will be used in a block in the end.
I won't give you a neat formatted answer. Instead I will give you a clue that might help you solve it in your own manner. All of the data is in the entity list returned from this expression, assuming that you have selected an associative array. The outer 330 code is inside a 102 reactor code which probably triggers the contextual ribbon.
(entget
(cdr (assoc 330
(entget
(cdr (assoc 330
(entget (car (entsel)))))))))
Up now , I can get this data
(("Rows" "90 # 0" "90 # 1" "90 # 2") ("RowSpacing" "90 # 1" "90 # 1" "40 # 16.000000") ("RowElevation" "90 # 1" "90 # 1" "40 # 0.000000") ("Levels" "90 # 0" "90 # 1" "90 # 1") ("LevelSpacing" "90 # 1" "90 # 1" "40 # 1.000000") ("Items" "90 # 0" "90 # 1" "90 # 2") ("ItemSpacing" "90 # 1" "90 # 1" "40 # 16.000000") ("AxesAngle" "90 # 2" "90 # 1" "40 # 1.570796") ("AlignItems" "90 # 0" "90 # 1" "90 # 0"))
Seem to be , the last item on each list is the value for the first item .
I have to dig on other associative array, but as do not handle,yet, 2015, I need more samples