Arrayrect does not work through lisp as expected, command prompt appearance is different through lisp than running the command straight from commandline.
Intention is to use the Array as object, not classic array. Firstly ucs is here temporarily changed to give array intended direction (wondering why there is no angle option available in standard), spacing values are preset, for number of columns and rows code stops for user inputs:
(defun c:a25 ()
(command ".undo" "begin")
(command "ucs" pause pause "")
(setq xxx (ssget))
(command "arrayrect" xxx "" "col" pause "2.5" "r" pause "12" "0" "x")
(command "ucs" "p")
(command "undo" "end")
(princ)
)
In addition would be nice if array base point could be set same as temporary ucs 0,0.
Solved! Go to Solution.
Solved by dbroad. Go to Solution.
Starting the arrayrect command from lisp yields this sequence:
Command: (command "arrayrect" pause)
nil
1 found
Select objects:
Type = Rectangular Associative = Yes
Specify opposite corner for number of items or [Base point/Angle/Count] <Count>: c
Enter number of rows or [Expression] <4>: 3
Enter number of columns or [Expression] <4>: 4
Specify opposite corner to space items or [Spacing] <Spacing>: s
Specify the distance between rows or [Expression] <1'-4 5/32">: 4
Specify the distance between columns or [Expression] <1'-4 5/32">: 4
Select grip to edit array or [ASsociative/Base point/Rows/Columns/Levels/eXit]<eXit>:
It appears that there is an angle prompt but it comes first. Also there is no "COL" option. When scripting a command, do it on the command line first this way.
thank you, dbrod
for my particular case it's good as:
(defun c:a25 ()
(setq xxx (ssget))
(command "_arrayrect" xxx "" "b" pause "a" pause "c" "1" pause "s" "2.5" "r" "1" "12" "0" "x")
(princ)
)
assigning number of rows other than 1, or pausing for user input there, changes the sequence again, so additional modifications are needed then
Robert