Author Topic: Mtext reactor to change textsize...  (Read 2058 times)

0 Members and 1 Guest are viewing this topic.

Shade

  • Guest
Mtext reactor to change textsize...
« on: July 26, 2007, 10:15:52 AM »
How does one set the textsize system variable with activeX.

I am writing a reactor for the mtext command to change the layer to 'Notes' and the Textsize as per the dimscale.
I figured out how to set the layer and retrieve the dimscale, but i am lost on how to set the textsize variable?

Any help would be appreciated.


MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Mtext reactor to change textsize...
« Reply #1 on: July 26, 2007, 10:18:16 AM »
Use the document's SetVariable method.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Shade

  • Guest
Re: Mtext reactor to change textsize...
« Reply #2 on: July 26, 2007, 10:28:19 AM »
I didn't see an <ActiveTextSize> variable in the Active document properties.?

Does one have to set the <ActiveTextStyle> <LastHieght> in order to set the textsize variable.

If one does I see more potential in this route then just a system variable.



ronjonp

  • Needs a day job
  • Posts: 7529
Re: Mtext reactor to change textsize...
« Reply #3 on: July 26, 2007, 11:20:58 AM »
You could use this to set the height for all new text objects:

Code: [Select]
(if (not (zerop (getvar 'dimscale)))
  (setvar 'textsize (* (getvar 'dimscale) 0.125))
)

But if the text already exists, you are going to have to use something like (vla-put-height obj #).

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mkweaver

  • Bull Frog
  • Posts: 352
Re: Mtext reactor to change textsize...
« Reply #4 on: July 27, 2007, 08:56:47 AM »
The system variable is "TextSize"

I didn't see an <ActiveTextSize> variable in the Active document properties.?

Does one have to set the <ActiveTextStyle> <LastHieght> in order to set the textsize variable.

If one does I see more potential in this route then just a system variable.