I've used this lisp routine to redefine blocks and it works fine but I discovered an issue that I'm not certain how to approach. In a block that has a multiline attribute I have a field in it for the drawing properties title. When I redefine the block it only shows that theres a field there and doesn't populate the data. I tried updating the field with "_updatefield" and it updates 13 out of 14 fields, even though by my count there is only 7 fields for the particular block. If I go into edit the multiline attribute and cancel out it then populates the data from the drawing properties. So to get this to populate the data will I have to go into each block that I encounter this and edit the attribute and cancel out? Or is the a better method to approach this?
(defun c:ReDef ( / *error* oc spc doc block b ) (vl-load-com) ;; © Lee Mac 2010 ;; Full filename needed if block is not in the support path (setq BlocksToRedefine '( "M:\\CAD_Folder\\AutoCad_Library\\Layouts\\D_Size.dwg" ) ) (defun *error* ( msg ) (and oc (setvar 'CMDECHO oc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (setq spc (vlax-get (vla-get-ActiveDocument (vlax-get-acad-object)) (if (= 1 (getvar 'CVPORT)) 'PaperSpace 'ModelSpace) ) ) (setq oc (getvar 'CMDECHO)) (setvar 'CMDECHO 0) (foreach block BlocksToRedefine (if (setq b (findfile (strcat block (if (not (vl-filename-extension block)) ".dwg" "")))) (progn (vla-delete (vla-insertblock spc (vlax-3D-point '(0. 0. 0.)) b 1. 1. 1. 0. ) ) (vl-cmdf "_.attsync" "_N" (vl-filename-base b)) ) (princ (strcat "\n** Cannot Find Block: " block " **")) ) ) (setvar 'CMDECHO oc) (princ) )