Heres a modification of Lee's suggestion - - ; Multiple Editing (c)1994, Gary Goode; Updated version at: https://www.cadtutor.net/forum/topic/65888-lsp-file-wont-recognize-attribute-block-need-help/(defun C:ME nil (C:MultipleEditing)(princ))(defun C:MultipleEditing ( / *error* acDoc c e i L s ) (setq L '( ("ATTDEF" (x) (command "_.TEXTEDIT" x "")) ("INSERT" (x) (if (member '(066 . 1) (entget x)) (command "_.ATTEDIT" x))) ("TEXT" (x) (command "_.TEXTEDIT" x "")) ("MTEXT" (x) (command "_.TEXTEDIT" x "")) ("DIMENSION" (x) (command "_.TEXTEDIT" x "")) ("ARCALIGNEDTEXT" (x) (command "_.ARCTEXT" x)) ) ) (defun *error* ( m ) (and c (setvar 'cmdecho c)) (and acDoc (vla-EndUndoMark acDoc)) (and m (princ m)) (princ) ); defun *error* (cond ( (setq s (ssget "_:L-I" '((000 . "ATTDEF,*DIMENSION,TEXT,MTEXT,ARCALIGNEDTEXT,INSERT")))) (if vlax-get-acad-object (progn (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-EndUndoMark acDoc) (vla-StartUndoMark acDoc) ); progn ); if (and (setq c (getvar 'cmdecho)) (setvar 'cmdecho 0)) (repeat (setq i (sslength s)) (setq i (1- i) e (ssname s i) ) (initcommandversion) ((cdr (assoc (cdr (assoc 0 (entget e))) L)) e) ); repeat ) ); cond (*error* nil) (princ)); defun C:MultipleEditing
Couldn't figure out the ssget filter to select all the object types + attributed blocks (in theory Lee's suggestion should work - but I got XOR behavior, rather than OR).
So I had to iterate and check every block reference if its attributed.
And I hate posting "corrected" versions from a professional lispers that did 90% of the work.. but oh well, sorry Lee.
I find this routine quite useful, so thanks guys! |