I have a similar question so I didn't want to start a new thread...
I have a routine
I got a LOT of help with many years back called "Flip Arrows" which basically toggles through arrow types on a leader.
It works great, but I've recently been using MLEADERS most of the time, and I would like a routine that toggles through arrow types for MLEADERS.
I couldn't find anything out there that does this, and I don't know anything about the structure of MLEADERS to make it work.
Here is the Flip Arrows for a standard Leader:
(defun c:FA ;| FlipArrows |; (/ Ent VlaObj )
(vl-load-com)
(while (setq Ent (entsel "Select leader: " ) )
(progn
(vl-load-com )
(setq VlaObj (vlax-ename->vla-object (car Ent )) )
(if (= (vla-get-objectName VlaObj ) "AcDbLeader")
(cond
((= (vla-get-ArrowheadBlock VlaObj ) "" ) (vla-put-ArrowheadBlock VlaObj "Integral" ) )
((= (vla-get-ArrowheadBlock VlaObj ) "Integral" ) (vla-put-ArrowheadBlock VlaObj "DotBlank" ) )
((= (vla-get-ArrowheadBlock VlaObj ) "DotBlank" ) (vla-put-ArrowheadBlock VlaObj "Dot" ) )
((= (vla-get-ArrowheadBlock VlaObj ) "Dot" ) (vla-put-ArrowheadBlock VlaObj "DotSmall" ) )
((= (vla-get-ArrowheadBlock VlaObj ) "DotSmall" ) (vla-put-ArrowheadBlock VlaObj "" ) )
(t nil)
)
(princ "..wrong object type ! " )
)
(if (not (vlax-object-released-p VlaObj )) (vlax-release-object VlaObj ) ( ) )
)
)
(princ)
)
And my poor attempt to modify it to work with Mleaders:
(defun c:FOO ;| FlipArrows |; (/ Ent VlaObj )
(vl-load-com)
(while (setq Ent (entsel "Select mleader: " ) )
(progn
(vl-load-com )
(setq VlaObj (vlax-ename->vla-object (car Ent )) )
(if (= (vla-get-objectName VlaObj ) "AcDbMLeader")
(cond
((= (vla-get-Block VlaObj ) "" ) (vla-put-Block VlaObj "Integral" ) )
((= (vla-get-Block VlaObj ) "Integral" ) (vla-put-Block VlaObj "DotBlank" ) )
((= (vla-get-Block VlaObj ) "DotBlank" ) (vla-put-Block VlaObj "Dot" ) )
((= (vla-get-Block VlaObj ) "Dot" ) (vla-put-Block VlaObj "DotSmall" ) )
((= (vla-get-Block VlaObj ) "DotSmall" ) (vla-put-Block VlaObj "" ) )
(t nil)
)
(princ "..wrong object type ! " )
)
(if (not (vlax-object-released-p VlaObj )) (vlax-release-object VlaObj ) ( ) )
)
)
(princ)
)