(defun c:SLCT-MLDR (/ _MLAttValue BlockColl ss i e f)
(vl-load-com)
;http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/search-for-existing-mleader-wtih-attribute-value/td-p/3930707
;;; pBe 22May2013 ;;;
;; Demo for Mtext Block Attribute ;;;
(defun _MLAttValue (en et tag coll / n i attag)
(setq n -1
i (1- (vla-get-count et))
)
(while (and (null attag) (< n i))
(if (And (eq "AcDbAttributeDefinition"
(vla-get-ObjectName (setq x (vla-item et (setq n (1+ n)))))
)
(eq tag (vla-get-TagString x))
)
(setq attag (vla-getBlockAttributeValue en (vla-get-ObjectID x)))
)
)
)
(setq BlockColl
(vla-get-blocks (vla-get-ActiveDocument (vlax-get-acad-object)))
)
(if (setq ss (ssget "_:L" '((0 . "MULTILEADER"))))
(repeat (setq i (sslength ss))
(setq e (vlax-ename->vla-object (ssname ss (setq i (1- i)))))
(if (And
;(Eq (vla-get-ContentBlockName e) "_TagBox")
(Eq (vla-get-ContentBlockName e) "_TagTriangle")
(setq f (_mlattvalue
e
;(vla-item BlockColl "_TagBox")
(vla-item BlockColl "_TagTriangle")
"TAGNUMBER"
BlockColl
)
)
)
(princ (Strcat "\nDo your thing here with the value: \"" f "\""))
(princ "\nTag not Found:")
)
)
)(princ)
)
Minor nitpick:Fixed ... funny thing is I know that but did not translate to my fingers LOL.Code - Auto/Visual Lisp: [Select]
Is the same as:Code - Auto/Visual Lisp: [Select]
;)
...Here (https://www.theswamp.org/index.php?topic=48309.0) is a nice read on formatting your posts. Glad we got the problem sorted :)
Just curious here... How are you pasting the code with the numbers labeling each line? Im just using notepad.