@aliff_ahtenk wrote:
....
The goal is how do i select the secondly item between the array to change the size?
....
Step 4: Selecting the EVEN item on the ARRAY to change the diameter
.....
I would suggest a different approach. Rather than drawing a Circle, Arraying it, then finding every other one to change their size, I would put them in at their alternating sizes directly. This works for me [limited testing]:
(defun C:COE ; = Circles with Odd- & Even-position radii
(/ spc r1 r2 path etype plen cyc div inc)
(setq
spc (getdist "\nTarget spacing between Circles (to be rounded): ")
r1 (getdist "\nRadius of odd-position Circles: ")
r2 (getdist "\nRadius of even-position Circles: ")
); setq
(while
(not
(and
(setq path (car (entsel "\nPath object: ")))
(setq etype (cdr (assoc 0 (entget path))))
(wcmatch etype "*LINE,CIRCLE,ARC,ELLIPSE")
(not (wcmatch etype "XLINE,MLINE"))
); and
); not
(prompt "\nNothing selected, or invalid path type.")
); while
(setq
plen (vlax-curve-getDistAtParam path (vlax-curve-getEndParam path))
cyc (atoi (rtos (/ plen (* spc 2)) 2 0))
div (/ plen (* cyc 2))
inc -1
); setq
(repeat (* cyc 2)
(command "_.circle"
"_non" (vlax-curve-getPointAtDist path (* div (setq inc (1+ inc))))
(if (= (rem inc 2) 0) r1 r2)
); command
); repeat
(if (not (vlax-curve-isClosed path))
(command "_.circle" "_non" (vlax-curve-getEndPoint path) r1)
); if
(princ)
)
If it makes the right kind of result, it can have command echoing suppressed, it could be made to remember your spacing and radii choices and offer them as defaults, it could supply initial first-use default values, it could put the Circles on the Layer of the path, or on any other Layer you want to specify, it could have *error* handling added if anything above changes something that should be set back, it could be wrapped in an Undo begin/end so U will undo all of it at once, it could be made to do it on multiple objects at once, or multiple single objects picked one at a time but within one running of the command, etc.
[On a closed path, it actually makes an even number of Circles, so they can alternate in size regularly even across the beginning/ending point.]
Kent Cooper, AIA