Hello.
I'm trying to make something that will just allow you to keep adding mleaders (the kind with the circle and attribute).
Basically I just want it to start at number 1 and keep going until the user stops or whatever, I wrote this little bit (doesn't work) for an example. Not sure if I'm even doing this right, but can't find anything on this subject directly.
(defun addCircleLeader (/ layout point1 point2 points cntr array leader)
(setq layout (vla-get-paperspace (vla-get-activedocument (vlax-get-acad-object))))
(repeat (getint "\nNumber of times to repeat:")
(setq
point1 (getpoint "\nSelect arrow point")
point2 (getpoint "\nSelect landing point")
points (list (car point1)(cadr point1)(caddr point1)(car point2)(cadr point2)(caddr point2))
cntr 1)
(setq array (vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray vlax-vbdouble
(cons 0 (1- (length points)))) points)))
(setq leader (vla-addmleader layout array cntr))
(vla-put-contentblockname leader "_TagCircle - Imperial")
(vla-setblockattributevalue leader (vla-get-objectid leader) (rtos cntr)) ;<-- doesn't like this..
(setq cntr (1+ cntr))
)
)
thanks in advance.
-ArgV