Author Topic: Change width of all text styles  (Read 1337 times)

0 Members and 1 Guest are viewing this topic.

Dave M

  • Newt
  • Posts: 196
Change width of all text styles
« on: May 03, 2016, 05:14:59 PM »
I am updating about 100 sheets where someone took it upon themselves to change the width of all the text styles.  Does anyone have a routine that would let me change them all back to what they should be?  I took a look around but didn't see anything that fit the bill.


Thanks in advance!
Civil 3D 2018 - Microstation SS4 - Windows 10 - Dropbox

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Change width of all text styles
« Reply #1 on: May 04, 2016, 07:33:17 AM »
The following will set the width of all text styles in the DWG to 1.0.

Code: [Select]

(vl-load-com)
(vlax-for x
     (vla-get-TextStyles
       (vla-get-activedocument (vlax-get-acad-object))
     )
  (vlax-put x 'width 1.0)
)






Note that changing the properties of the style will not necessarily update existing text/mtext objects that use this style.






Dave M

  • Newt
  • Posts: 196
Re: Change width of all text styles
« Reply #2 on: May 04, 2016, 12:00:24 PM »
The following will set the width of all text styles in the DWG to 1.0.

Code: [Select]

(vl-load-com)
(vlax-for x
     (vla-get-TextStyles
       (vla-get-activedocument (vlax-get-acad-object))
     )
  (vlax-put x 'width 1.0)
)






Note that changing the properties of the style will not necessarily update existing text/mtext objects that use this style.


That worked.  Thanks for you help!
Civil 3D 2018 - Microstation SS4 - Windows 10 - Dropbox

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Change width of all text styles
« Reply #3 on: May 04, 2016, 12:33:46 PM »
Sure, that was something I had cooked up a long time ago to change _fonts_ on every style, just made the quick mod to change the width instead.