leonucadomi Posted May 24 Posted May 24 Hello people: I need to adjust the size of texts in model space The problem is that there is text, mtext and attributes Does anyone have an LSP routine in which you can enter the desired text height and modify it globally in a selection per window? Any comments are welcome, thank you. Quote
Steven P Posted May 24 Posted May 24 Weekend so CAD is off but, you should be able to work this out - the syntax below isn't correct, just to give you the idea: (ssget....) with a filter for text, mtext and attributes (ssget '((0 . "*text,attribute"))) - noting the wild card in text to get mtext too (setq counter 0) - a counter, can call it anything (while (< counter < sslength (selection set))) (setq ent (ssname counter (selection set))) Then entmod the text size (dxf code 40) - the autodesk help from the search "autocad lisp entmod" gets a good example set counter + 1 End while loop Quote
GLAVCVS Posted May 24 Posted May 24 (edited) Maybe this will help you (defun c:altObjs (/ cj a e l n at vlaObj) (if (setq a (getreal "\nNew height for (M)Texts/attributes: ")) (if (setq cj (ssget '((0 . "*TEXT,INSERT")))) (while (setq e (ssname cj (setq n (if n (1+ n) 0)))) (if (wcmatch (cdr (assoc 0 (setq l (entget e)))) "*TEXT") (entmod (subst (cons 40 a) (assoc 40 l) l)) (if (= (vla-get-hasAttributes (setq vlaObj (vlax-ename->vla-object e))) :vlax-true) (foreach at (vlax-safearray->list (variant-value (vla-getattributes vlaObj))) (vla-put-Height at a) ) ) ) ) ) ) (princ) ) Edited May 24 by GLAVCVS 2 1 Quote
GLAVCVS Posted May 24 Posted May 24 Note: Note that the iteration uses foreach, not vlax-for. This is to make the code compatible with older versions of AutoCAD. 1 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.