;; | --------------------------------------------------------------------------- ;; | BL_FindAttr ;; | --------------------------------------------------------------------------- ;; | Function : Find the attrribute in a block given the tag value ;; | Argument : 'ename' - entity name of the block ;; | 'tag' - tag value to search for ;; | Returns : The attribute entity name, if it exists otherwise nil is ;; | returned ;; | Updated : November 12, 1998 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | --------------------------------------------------------------------------- (defun BL_FindAttr( ename tag / tmp entl en cnt More _tag aname More ) (setq entl (entget ename) tmp (LI_item 66 entl) aname nil ) (if (and tmp (not (zerop (logand tmp 1)))) (progn (setq en "ATTRIB" aname nil tag (strcase tag) More T ) (while More (setq ename (entnext ename) entl (entget ename) en (LI_item 0 entl) ) (if (= en "ATTRIB") (progn (setq _tag (strcase (LI_item 2 entl))) (if (= tag _tag) (setq aname ename More nil ) ) ) (setq More nil) ) ) )) aname )