Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/29/2024 in all areas

  1. You can add MV to the start of the list using (cons mv-string (mapcar ...)) I edited my post above. You can change the text by editing all the stuff between strcat.
    1 point
  2. I guess this can help you with what you are looking for (defun c:test ( ) (pstext (getstring t "\nSpecify Prefix <none>: ") (getstring t "\nSpecify Suffix <none>: ") 1) ) ;; (pstext "Prefix Text" "Suffix Text" <mode>) ;; ;; <mode> = 0 - single selection ;; = 1 - window selection ;; ;; Author: Lee Mac 2011 - www.lee-mac.com (defun pstext ( preftext sufftext mode / a e i s ) (cond ( (= 0 mode) (while (progn (setvar 'ERRNO 0) (setq e (car (nentsel))) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, try again.") ) ( (eq 'ENAME (type e)) (if (wcmatch (cdr (assoc 0 (entget e))) "TEXT,MTEXT,ATTRIB,*LEADER,*DIMENSION") (entmod (setq e (entget e) a (assoc 1 e) e (subst (cons 1 (strcat preftext (cdr a) sufftext)) a e) ) ) (princ "\nInvalid Object.") ) ) ) ) ) ) ( (setq s (ssget "_:L" (list '(0 . "TEXT,MTEXT,ATTRIB,*LEADER,*DIMENSION")))) (repeat (setq i (sslength s)) (entmod (setq e (entget (ssname s (setq i (1- i)))) a (assoc 1 e) e (subst (cons 1 (strcat preftext (cdr a) sufftext)) a e) ) ) ) ) ) (princ) )
    1 point
  3. Re a specified number of times You can use repeat as well as a while (repeat 3 ... your code ) or (setq x 1) (while (< x 4) ...... your code (setq x (+ x 1)) )
    1 point
×
×
  • Create New...