Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Array Column and Row Vaues

15 REPLIES 15
Reply
Message 1 of 16
RockyBrown4134
976 Views, 15 Replies

Get Array Column and Row Vaues

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

 

array.jpg

Thanks.

 

 

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
15 REPLIES 15
Message 2 of 16
devitg
in reply to: RockyBrown4134

Please upload a sample dwg , where you want to apply, it . The array , was made by the array commnad? Or it is a user custom array .?
Message 3 of 16
RockyBrown4134
in reply to: devitg

Array is inside the block "ped_pln". It was created with the ARRAY command accessed from the Ribbon.

 

array3.jpg

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
Message 4 of 16

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.

Kent Cooper, AIA
Message 5 of 16
stevor
in reply to: RockyBrown4134

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.

S
Message 6 of 16
devitg
in reply to: RockyBrown4134

It is a block , with the 4 hole as a block , each hole as a block , and at last a circle
Message 7 of 16
RockyBrown4134
in reply to: devitg


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.

 

ARRAY_4.jpg

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
Message 8 of 16
Kent1Cooper
in reply to: stevor


@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.

Kent Cooper, AIA
Message 9 of 16
devitg
in reply to: RockyBrown4134

If so please upload it as a true DWG , not as a block .
Message 10 of 16
RockyBrown4134
in reply to: devitg


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.

If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
Message 11 of 16
devitg
in reply to: RockyBrown4134

Hi , I only ask for the DWG , because I want to see the problem at its original state . As I can see the 4 hole are in a block, and each hole is a block itself, maybe done by ARRAY COMMAND, as you said. But such block do not hold any property as result of an ARRAY COMMAND, it was lost when it was converted to a block. I will dig on the block , to get the values you need.
Message 12 of 16
dbroad
in reply to: RockyBrown4134

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)))))))))

Architect, Registered NC, VA, SC, & GA.
Message 13 of 16
devitg
in reply to: dbroad

RockyBrown4134, please apologize me , I use ACAD 2008 , and it do not have the ARRAY enty . I will try at ACAD2015
Message 14 of 16
RockyBrown4134
in reply to: devitg

devitg;

Thanks. No apology needed. Been there ( 2008) before.
If this response answers your question, Please mark this response as "Accept as Solution"

Rocky Brown
AutoCAD 2020 / Inventor 2020 / Plant 3D
Message 15 of 16
devitg
in reply to: RockyBrown4134

Hi RockyBrown, would you , please, send me more such samples? I think I can handle it by lisp , dbroad give me the start kick to solve it . (entget (cdr (assoc 330 (entget (cdr (assoc 330 (entget (car (entsel)))))))))
Message 16 of 16
devitg
in reply to: devitg

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 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost