;; ;; tedit.lsp - generic text editing ;; ;; Copyright © 2000 by Autodesk, Inc. ;; ;; Your use of this software is governed by the terms and conditions of the ;; License Agreement you accepted prior to installation of this software. ;; Please note that pursuant to the License Agreement for this software, ;; "[c]opying of this computer program or its documentation except as ;; permitted by this License is copyright infringement under the laws of ;; your country. If you copy this computer program without permission of ;; Autodesk, you are violating the law." ;; ;; AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. ;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF ;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. ;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE ;; UNINTERRUPTED OR ERROR FREE. ;; ;; Use, duplication, or disclosure by the U.S. Government is subject to ;; restrictions set forth in FAR 52.227-19 (Commercial Computer ;; Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) ;; (Rights in Technical Data and Computer Software), as applicable. ;; ;; ---------------------------------------------------------------- ;; ;; DESCRIPTION ;; The TEDIT command provides a single command for editing all ;; forms of annotation objects. ;; ;; ---------------------------------------------------------------- (defun C:TEDIT (/ noll filter ss idx ename elist kind) ;; remove objects on locked layers from ss (defun noll (ss / i d ename) (setq i 0 d 0 ) (while (and ss (setq ename (ssname ss i)) ) (if (acet-layer-locked (cdr (assoc 8 (entget ename)))) (progn (ssdel ename ss) (setq d (1+ d)) ) (setq i (1+ i)) ) ) (if (/= 0 d) (princ (acet-str-format "%1 %2 on a locked layer.\n" d (if (< 1 d) "were" "was") ) ) ) ss ) (acet-error-init '(("CMDECHO" 0) T)) ;; make object filter (setq filter (list (cons 410 (if (and (= 0 (getvar "TILEMODE")) (/= 1 (getvar "CVPORT")) ) "Model" (getvar "CTAB") ) ) '(-4 . "") '(-4 . "OR>") ) ) ;; pick objects (if (not (and (= 1 (logand 1 (getvar "PICKFIRST"))) (setq ss (noll (ssget "_I" filter))) ) ) (setq ss (ssget "_:L" filter)) ) ;; process ss (if ss (progn (setq idx -1) (acet-ui-progress "Editing:" (sslength ss)) (sssetfirst) (redraw) (while (setq ename (ssname ss (setq idx (1+ idx)))) (redraw ename 3) (redraw) (setq elist (entget ename) kind (cdr (assoc 0 elist)) ) (cond ((or (= kind "TEXT") (= kind "MTEXT") (= kind "DIMENSION") (= kind "ATTDEF") ) (command "_.DDEDIT" ename "") ) ((= kind "INSERT") (command "_.DDATTE" ename) ) ((= kind "ARCALIGNEDTEXT") (command "_.ARCTEXT" ename) ) ((= kind "RTEXT") (if (or (= 'USUBR AcetRText:edit) (load "rtext" nil)) (AcetRText:edit elist) (princ "TEDIT: Cannot edit RTEXT objects.\n") ) ) ) (entupd ename) (redraw ename 4) (acet-ui-progress -1) ) (acet-ui-progress) (sssetfirst nil ss) ) ) (acet-error-restore) (princ) ) (acet-autoload2 '("Rtext.lsp" (AcetRText:edit ent))) (princ)