leonucadomi Posted December 13, 2023 Share Posted December 13, 2023 hello friends: I have a routine to change the texts in these blocks. The problem is that I have to click on each one of them. I would like to make a selection in the window and change text size to 20. any recommendation is welcome. WELD.dwg Quote Link to comment Share on other sites More sharing options...
EnM4st3r Posted December 13, 2023 Share Posted December 13, 2023 can you post the routine? 1 Quote Link to comment Share on other sites More sharing options...
leonucadomi Posted December 13, 2023 Author Share Posted December 13, 2023 sure (defun C:test ( / e) (setq e (vlax-ename->vla-object (car (nentsel "\n Select an attribute to change:")))) (vla-put-height e 20) (princ) ) Quote Link to comment Share on other sites More sharing options...
EnM4st3r Posted December 13, 2023 Share Posted December 13, 2023 you could cycle trough the attributes with entnext until you have all attributes then appl the changes to them Quote Link to comment Share on other sites More sharing options...
pkenewell Posted December 13, 2023 Share Posted December 13, 2023 (edited) Something like this? Quickly written and tested and no minimal error handling: EDIT: Added an option to enter the text height or default to 20. (defun c:foo (/ at dc ht i n obj ss) (vl-load-com) (vla-startundomark (setq dc (vla-get-activedocument (vlax-get-acad-object)))) (if (and (setq ss (ssget '((0 . "INSERT")))) (setq ht (getreal "\nEnter Height Value <20.0>: ") ht (if ht ht 20.0) ) ) (repeat (setq i (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i)))) at (vla-getattributes obj) at (if at (vlax-variant-value at)) n 0 ) (while (and at (>= (vlax-safearray-get-u-bound at 1) n)) (vla-put-height (vlax-safearray-get-element at n) ht) (setq n (1+ n)) ) ) ) (vla-endundomark dc) (princ) ) Edited December 13, 2023 by pkenewell Corrections 1 Quote Link to comment Share on other sites More sharing options...
leonucadomi Posted December 13, 2023 Author Share Posted December 13, 2023 thanks Quote Link to comment Share on other sites More sharing options...
pkenewell Posted December 13, 2023 Share Posted December 13, 2023 18 minutes ago, leonucadomi said: thanks @leonucadomi Just did an update for corrections. Please re-copy and try it. 1 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.