To select multiple objects, use **`ssget`** instead of `entsel`, and then apply `setpropertyvalue`
to each selected object in a loop.
Select several objects using a frame, or one at a time.
For all selected objects, the **Annotative** property will change to **No**.
The filter allows you to select:
`TEXT`, `MTEXT', `DIMENSION`, `MULTILEADER`
**Objects are not deleted or recreated.** Only the `Annotative` property is changed.
; "Annotative" 0 /No/
(defun c:NoAnno (/ ss i) ; AI
;; (if (setq ss (ssget '((0 . "TEXT,MTEXT,DIMENSION,MULTILEADER"))))
(if (setq ss (ssget "_:L" '((0 . "TEXT,MTEXT,DIMENSION,MULTILEADER")))) ; remark of Paul Li
(progn
(setq i 0)
(repeat (sslength ss)
(setpropertyvalue (ssname ss i) "Annotative" 0)
(setq i (1+ i))
)
(princ (strcat "\nProcessed objects: " (itoa i)))
)
)
(princ)
)
; "Annotative" 1 /Yes/
(defun c:YesAnno (/ ss i) ; AI
;; (if (setq ss (ssget '((0 . "TEXT,MTEXT,DIMENSION,MULTILEADER"))))
(if (setq ss (ssget "_:L" '((0 . "TEXT,MTEXT,DIMENSION,MULTILEADER")))) ; remark of Paul Li
(progn
(setq i 0)
(repeat (sslength ss)
(setpropertyvalue (ssname ss i) "Annotative" 1)
(setq i (1+ i))
)
(princ (strcat "\nProcessed objects: " (itoa i)))
)
)
(princ)
)
;;; Remove/Add Annotative property to objects [No/Yes] (default No)
;;; Supported objects: TEXT, MTEXT, DIMENSION, MULTILEADER
(defun c:SetAnno (/ ss i ans val)
;; Prompt the user, default is No
(initget "No Yes")
(setq ans (getkword "\nRemove/Add Annotative property to objects [No/Yes] <No>: "))
(if (not ans) (setq ans "No")) ; if Enter pressed — use No
(setq val (if (= ans "Yes") 1 0)) ; Yes = 1, No = 0
;; (if (setq ss (ssget '((0 . "TEXT,MTEXT,DIMENSION,MULTILEADER"))))
(if (setq ss (ssget "_:L" '((0 . "TEXT,MTEXT,DIMENSION,MULTILEADER")))) ; remark of Paul Li
(progn
(setq i 0)
(repeat (sslength ss)
(setpropertyvalue (ssname ss i) "Annotative" val)
(setq i (1+ i))
)
(princ (strcat "\nProcessed objects: " (itoa i)
" | Annotative = " ans))
)
(princ "\nNo objects selected.")
)
(princ)
)