Pnoraa1 Posted January 21, 2020 Share Posted January 21, 2020 Hi I created this lisp from parts of other lisps I found and it works fine to resize text that is height 8 and 6 to 0.2, however, it spits an error if there is no text in the drawing at 6 or 8mm. Is anyone able to provide assistance as to how resolve this, I'm assuming I need to first check if text at each of these heights exists first but I can't find out how to do this. (defun C:FIXTXT ()(vl-load-com) (foreach ent (mapcar 'cadr (ssnamex (ssget "X" (list '(0 . "TEXT") (cons 40 6))))) (vla-put-height (vlax-ename->vla-object ent) 0.2)) (foreach ent (mapcar 'cadr (ssnamex (ssget "X" (list '(0 . "TEXT") (cons 40 8))))) (vla-put-height (vlax-ename->vla-object ent) 0.2)) Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 22, 2020 Share Posted January 22, 2020 Hi, Welcome to the forum. Try the following although it would be much better if you just used the DXF codes instead of converting each object to vla-object in this case but anyway that works as well. (defun C:FIXTXT (/ ss) (if (setq ss (ssget "X" '((0 . "TEXT") (-4 . "<OR") (40 . 6) (40 . 8) (-4 . "OR>")))) (foreach ent (mapcar 'cadr (ssnamex ss)) (vla-put-height (vlax-ename->vla-object ent) 0.2) ) ) (princ) ) (vl-load-com) Quote Link to comment Share on other sites More sharing options...
Pnoraa1 Posted March 10, 2020 Author Share Posted March 10, 2020 Thanks for the help, works perfectly. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted March 11, 2020 Share Posted March 11, 2020 13 hours ago, Pnoraa1 said: Thanks for the help, works perfectly. You're welcome anytime. Quote Link to comment Share on other sites More sharing options...
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.