I'm trying to create a function which will remove all attributes from any block. The attributes need to be removed from all instances of the block.
I wrote my function as below.
It deletes the attributes, but when the Attsync command is called, AutoCAD tells me the following:
"Block table contains no attributed block named SomeBlock2", and the attributes are still displayed.
If, after this function has run, I manually type "ATTSYNC", and select one of the blocks, they will properly clean up the blocks.
Is there any way of properly attsyncing the block after the attributes have been deleted using this method?
(defun DeleteAtts (BName / Binfo En El EnTyp AttSync)
(setq BInfo (tblsearch "BLOCK" BName)
En (cdr (assoc -2 BInfo))
(setq El (entget En)
EnTyp (cdr (Assoc 0 El))
(if (= EnTyp "ATTDEF")
(setq AttSync T)
(setq En (entnext En))
(command "ATTSYNC" "N" Bname)