JONTHEPOPE Posted July 30, 2008 Posted July 30, 2008 ;q ;q (defun chgtext1() (setvar "cmdecho" 0) (setq newht (getreal "\n Enter new text height; ")) (setq ss1 (ssget)) (setq name (ssname ss1 0)) (setq ent (entget name)) (setq oldlist (assoc 40 ent)) (setq conlist (cons (car oldlist) newht)) (setq newlist (subst conlist oldlist ent)) (entmod newlist) (setvar "cmdecho" 1) (princ) ) Please use [ CODE ] tags. Quote
Strix Posted July 30, 2008 Posted July 30, 2008 what's that for? can you be a little less cryptic in your posts please? We like threads to be useable and searchable Quote
JONTHEPOPE Posted July 30, 2008 Author Posted July 30, 2008 Lisp Code. Save File As .lsp In Note Pad . Load File And Type (chgtext1) In Lisp Console> Quote
rkmcswain Posted July 30, 2008 Posted July 30, 2008 I'm assuming that you are posting this as code for others to use, so I'm moving this thread to the Autolisp Archive forum Allow me to make a few changes for consideration... 1. declare variables local 2. restore cmdecho value that was set, not just set it to 1 3. use (getdist) in text height prompt so user can pick height 4. Add c: prefix so the parenthesis are not needed to call this function (defun C:chgtext1 (/ CMDECHO CONLIST ENT NAME NEWHT NEWLIST OLDLIST SS1) (setq cmdecho (getvar "cmdecho")) (setvar "cmdecho" 0) (setq newht (getdist "\n Enter new text height; ")) (princ "\nSelect text: ") (setq ss1 (ssget)) (setq name (ssname ss1 0)) (setq ent (entget name)) (setq oldlist (assoc 40 ent)) (setq conlist (cons (car oldlist) newht)) (setq newlist (subst conlist oldlist ent)) (entmod newlist) (setvar "cmdecho" cmdecho) (princ) ) 1 Quote
Lee Mac Posted April 1, 2009 Posted April 1, 2009 Just to elaborate on RKMcSwain's code, this filters out non-text entities and allows for errors in input: (defun c:chgtxt (/ ht ss) (vl-load-com) (if (and (setq ht (getdist "\nSpecify New Text Height: ")) (setq ss (ssget '((0 . "*TEXT"))))) (foreach x (mapcar 'entget (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) (entmod (subst (cons 40 ht) (assoc 40 x) x)))) (princ)) 1 Quote
brianfengming Posted July 30, 2021 Posted July 30, 2021 On 4/1/2009 at 7:16 PM, Lee Mac said: Just to elaborate on RKMcSwain's code, this filters out non-text entities and allows for errors in input: (defun c:chgtxt (/ ht ss) (vl-load-com) (if (and (setq ht (getdist "\nSpecify New Text Height: ")) (setq ss (ssget '((0 . "*TEXT"))))) (foreach x (mapcar 'entget (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) (entmod (subst (cons 40 ht) (assoc 40 x) x)))) (princ)) is it possible to change all the text height in block? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.