Default TextStyle for DxfModel

1
Joe B
1/13/2017 4:19 PM

Would it be possible to get a property to set the default TextStyle for a DxfModel, similar to how it was done for DimensionStyle as in the following post?

https://www.woutware.com/Forum/Topic/1220

DxfModel.DefaultTextStyle already exists but it is a ReadOnly property and can't be changed.

Wout
1/13/2017 4:48 PM

What would be your usecase? You can change the text style's properties if you need to change the default text style.

- Wout

Joe B
1/13/2017 4:52 PM

Just as a way to give users a shortcut to default to this or that TextStyle if they open up a DWG file (DxfModel) to edit. Our application does some work to produce some lines and shapes then uses CadLib to export a DWG file for users. Most of the time they use it as-is, but sometimes they open it up to do a bit of customizing and this may involve adding Dimensions or Text or whatever.

Originally we just had them use a script in AutoCAD to set these defaults whenever they opened a drawing but then I read found the thread concerning this property CurrentDimensionStyle (which we use now!) and wanted to see if doing the same for TextStyle would be a reasonable request.

Wout
1/13/2017 5:03 PM

The property analogous to DxfModel.CurrentDimensionStyle would be DxfHeader.CurrentTextStyle for text styles (this does not have to be the "Standard" text style). DxfModel.CurrentDimensionStyle is just a convenience property that is the same as DxfHeader.DimensionStyle.

DxfModel.DefaultTextStyle is the text style with name "Standard". So if you would want to make another existing text style in the text style table the default, it would have to change its name to "Standard". And since there should be only one with the name "Standard", the other one should be removed. There should be normally no need for this, so therefore DxfModel.DefaultTextStyle is just a convenience readonly property.

- Wout

Joe B
1/13/2017 5:06 PM

I must have missed this property on DxfHeader, this accomplishes exactly what I requested. Thanks again.

1