Hi Howard,
>>"The blocks are all on separate layouts."
You already said that / I already understood that.
>>"My knowledge of lisp is non existent."
I showed one way without lisp and one with, what needs no lispknowledge.
->select all of your title blocks and change the value in Properties palette CTRL+1
Object selection:
Without Lisp: Use command FILTER , filter for your Blockname and apply to ALL<enter>
With Lisp, direct in Commandline: (sssetfirst nil (ssget "_X" '((2 . "YourBlockName"))))
>>"Unfortunately the lisp you posted in that thread didn't work"
It works!
>>"I need to be able to change the attribute even when it is blank."
Ahh okay, so you can not use GatteLT, I understand.
In this case, the program need to know the name of the attribute !?
for you:
(defun C:GatteLT_HW ( / ESel EL BN TG newstr n ss1)
(setq ESel (entsel "\nSelect Block: "))
(setq EL (entget (car ESel)))
(if (= (cdr (assoc 0 EL)) "INSERT")
(setq BN (cdr (assoc 2 EL))
TG "YOURATTRIBNAME" ; UPPERCASE!
)
(prompt "\nSelected item not an INSERT.")
);end if
(setq newstr (getstring "\nEnter new attribute value "))
(setq n -1)
(if (setq ss1 (ssget "_X" (list (cons 0 "INSERT") (cons 2 BN))))
(repeat (sslength ss1)
(setq n (1+ n))
(foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 n)) 'getattributes)
(if (= TG (strcase (vla-get-tagstring att)))
(vla-put-textstring att newstr)
) ; end if
) ; end foreach
) ; end repeat
);_if
(princ)
)
Lisp(cope) How to handle, read this page <Click>
- Saving the AutoLISP File
- Loading the Program Method 1 or drag&drop the file into drawing editor
- Running the Program