Hi,
You can try this........(command is "EB")
(defun ATTDEL (blkname attname / bn bd en ed attlst)
(vl-load-com)
(if (setq bn (tblobjname "BLOCK" blkname))
(progn
(setq bd (entget bn)
en (cdr (assoc -2 bd))
attlst nil
)
(while en
(setq ed (entget en))
(if (= "ATTDEF" (cdr (assoc 0 ed)))
(setq attlst (cons (cons (strcase (cdr (assoc 2 ed))) (vlax-ename->vla-object en)) attlst))
)
(setq en (entnext en))
)
(if (setq en (assoc (strcase attname) attlst))
(progn
(setq ed (cdr en))
(vla-Delete ed)
(command "_.ATTSYNC" "_Name" blkname)
)
)
)
)
(princ)
)
(defun TEXTDEL (nme val / acdoc lst Blockdefinition txt)
(vl-load-com)
(setq acdoc (vla-get-activedocument (vlax-get-acad-object)))
(setq lst '())
(if (not (member nme lst))
(progn
(setq Blockdefinition (vla-item (vla-get-blocks acdoc) nme))
(vlax-for x Blockdefinition
(if (and
(eq :vlax-false (vla-get-isxref Blockdefinition))
(eq :vlax-false (vla-get-islayout Blockdefinition))
(eq (vla-get-objectname x) "AcDbText")
)
(progn
(setq txt (vla-get-textString x))
(if (= txt val)(vla-delete x))
)
)
)
(setq lst (cons nme lst))
)
)
(princ)
(vla-regen acdoc acAllViewports)
(princ)
)
(defun C:EB (/)
(ATTDEL "36x24_TB" "ACCURACY_STATUS")
(TEXTDEL "36x24_TB" "Verification:")
(princ)
)
For more check this ......
Delete Attribute and for Delete Text
Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....