Array Command Immediately Goes to Number of Rows

Array Command Immediately Goes to Number of Rows

mgorecki
Collaborator Collaborator
506 Views
7 Replies
Message 1 of 8

Array Command Immediately Goes to Number of Rows

mgorecki
Collaborator
Collaborator

Hi,

I'm trying to use the array command in my LiSP routine, but it's giving me a headache.  

The command I'm using is:

(command "-array" selSet "" "_rectangular" "_col" numOfPanels panelPitch "_rows" 1 "" "" "as" "no" "")

The AutoCad command line shows:

Command: -array

Select objects: Enter the type of array [Rectangular/Polar] <R>: _rectangular
Enter the number of rows (---) <1>: _col
Requires an integer between 1 and 32767.

 

If anyone can help, I'd greatly appreciate it.

0 Likes
Accepted solutions (1)
507 Views
7 Replies
Replies (7)
Message 2 of 8

Kent1Cooper
Consultant
Consultant
Accepted solution

Command-line versions of commands when used in AutoLisp (command) functions sometimes operate a little differently than the way they do when you do them "raw."  Array asks for things in a particular order, instead of offering a menu of options that you can choose to supply in any order.  Just give it the row information first, and the rest in the order it wants.  To find out what that order is, run it manually but using:

(command "_.array")

to start it, rather than typing in ARRAY or choosing the ribbon icon.

Kent Cooper, AIA
0 Likes
Message 3 of 8

calderg1000
Mentor
Mentor

Regards @mgorecki 

try this...

 

(defun c:test( / )
(command "_array" pause "" "R" pause pause pause pause)
  )

 

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

0 Likes
Message 4 of 8

Moshe-A
Mentor
Mentor

@mgorecki ,

 


@mgorecki wrote:

Hi,

I'm trying to use the array command in my LiSP routine, but it's giving me a headache.  

The command I'm using is:

(command "-array" selSet "" "_rectangular" "_col" numOfPanels panelPitch "_rows" 1 "" "" "as" "no" "")

The AutoCad command line shows:

Command: -array

Select objects: Enter the type of array [Rectangular/Polar] <R>: _rectangular
Enter the number of rows (---) <1>: _col
Requires an integer between 1 and 32767.

 

If anyone can help, I'd greatly appreciate it.


to add to what other experts said, i assume col is an integer value? do not put it in "col"

 

0 Likes
Message 5 of 8

Kent1Cooper
Consultant
Consultant

@Moshe-A wrote:

@mgorecki ,

 


@mgorecki wrote:

....

(command "-array" selSet "" "_rectangular" "_col" numOfPanels panelPitch "_rows" 1 "" "" "as" "no" "")

....


to add to what other experts said, i assume col is an integer value? do not put it in "col"


I think their intent was to call for the COLumns option that is available when the command is run outside AutoLisp, in which case having it in quotation marks would be appropriate.  Then their numOfPanels variable would be the integer value for that.  But when inside an AutoLisp (command) function, you don't get to choose the order in which you give it values -- you don't even get option choices -- but must supply them in the order in which it asks for them.  Nor do you get the ASsociative option at all, which they are trying to choose and answer "no" to.

 

This should do:

(command "_.array" selSet "" "_rectangular" 1 numOfPanels panelPitch)

 

Maybe preceding it with (initcommandversion) could be made to have it operate more like what they're intending, but I don't see any need if they don't want it Associative or to use any of the other fancy options -- plain columns in one row may as well be the basic command.

Kent Cooper, AIA
0 Likes
Message 6 of 8

komondormrex
Mentor
Mentor

hey,

why do not you go vlax?

 

(foreach object (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex selSet))))
	(vla-arrayrectangular object 1 numOfPanels 1 1 panelPitch 1)
)

 

 

0 Likes
Message 7 of 8

mgorecki
Collaborator
Collaborator

Hi Kent, thanks.  I wasn't sure if it was just my computer and the settings I have.  A lot of people use this program, and I wanted to make sure it worked for everyone.  I thought that I could just enter a 1 for rows, but wasn't sure if it would react the same on everyone else's computer.

Thanks for the help, I used your suggestion.

0 Likes
Message 8 of 8

mgorecki
Collaborator
Collaborator

Thank you to everyone else that took the time to reply.  This community is awesome.

0 Likes