This can be a start:
; Function: ALE_Block_GetAttributesFilter
;
; Version 1.00 - 30/11/2005
;
; Description:
; returns a list of all attributes matching Tag names and Tag values
;
; Arguments:
; VlaObj: [VLA-OBJECT]
; TagNms: Tag names - Wcmatch string > "Date,Scale" or "*" for all
; TagVls: Tag values - Wcmatch string > "*2005,1:10" or "*" for all
;
; Return Values: LIST
; tag value ObjectID vla-object
; (("Tag1" "Val1" 2130160792 #<VLA-OBJECT IAcadAttributeReference 0abb21e4>) ...)
;
(defun ALE_Block_GetAttributesFilter (VlaObj TagNms TagVls / AttObj TagNam TagVal OutLst)
(if
(and
(= 'VLA-OBJECT (type VlaObj))
(= (vla-get-hasattributes VlaObj) :vlax-true)
)
(foreach ObjFor (vlax-invoke VlaObj 'GetAttributes)
(if
(and
(wcmatch (setq TagNam (vla-get-TagString ObjFor)) (strcase TagNms))
(wcmatch (strcase (setq TagVal (vla-get-TextString ObjFor))) (strcase TagVls))
)
(setq OutLst (cons (list TagNam TagVal (vla-get-ObjectID ObjFor) ObjFor) OutLst))
)
)
)
OutLst
)