Community
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
@Anonymous wrote:
... but how do I find if the block definition (in block table) has the attribute?
One way
;; (attdef-p "YoutBlockName" "YourAttTag") ;; If true returns T otherwise nil (defun attdef-p (blkname tag / a b e) (if (setq b (tblobjname "block" blkname)) (while (and (setq b (entnext b)) (setq e (entget b)) ) (if (and (= (cdr (assoc 0 e)) "ATTDEF") (= (cdr (assoc 2 e)) tag) ) (setq a T) ) ) ) a )
Hope that helps
Henrique