Hello and thank you for looking.
The goal is to copy the properties of an existing leader and then start the leader command again. I can't seem to convert the object to a vla object in order to get the arrowheadblock.
Thanks!
(vl-load-com)
(defun c:qww (/ s en e vla_s LeaderName)
(if
(and (setq s (entsel "\nSelect any object: "))
(wcmatch (setq en (cdr (assoc 0 (setq e (entget (car s))))))
"LEADER"
)
)
(progn
;; This group of settings are common to all objects
;; layer
(setvar 'CLAYER (cdr (assoc 8 e)))
;; linetype
(if (cdr (assoc 6 e))
(setvar 'CELTYPE (cdr (assoc 6 e)))
(setvar 'CELTYPE "ByLayer")
)
;; color
(if (cdr (assoc 62 e))
(setvar 'CECOLOR (itoa (cdr (assoc 62 e))))
(setvar 'CECOLOR "ByLayer")
)
(if (wcmatch en "LEADER")
(progn
;;convert to vl object
(setq vla_s (vlax-ename->vla-object (ssname s 0)))
;(setq vla_s (vlax-ename->vla-object s))
(princ "\nfinally!")
(setq LeaderName (vla-get-ArrowheadBlock vla_s))
(setvar "DIMASZ" 0.125)
(command ".QLEADER" pause pause pause)
(command ".TEXT" pause)
(vla-put-ArrowheadBlock (entlast) LeaderName)
)
)
)
(prompt
"\nObject is not a LEADER."
)
)
(princ)
)