I wish to programmatically set the TextStyle for a dimension. I obtain a DgnTextStylePtr for the text style, and use it to get the ID ( textStylePtr->GetID() ). With that, I want to set the Text Style for the dimension:
iStatus = mdlDimStyle_setIntegerProp(pDimStyle, textStylePtr->GetID(), DIMSTYLE_PROP_Text_TextStyleID_INTEGER);
But in the help file, there is a statement to NOT do it this way:
"DIMSTYLE_PROP_Text_TextStyleID_INTEGER: The ID of the dimStyle's text style. Do not 'set' this value directly. To set the text style use
DIMSTYLE_PROP_Text_TextStyle_TEXTSTYLE"
DIMSTYLE_PROP_Text_TextSty
The doc lists DIMSTYLE_PROP_Text_TextStyle_TEXTSTYLE and an "int" value, but when I use:
iStatus = mdlDimStyle_setIntegerProp(pDimStyle, textStylePtr->GetID(), DIMSTYLE_PROP_Text_TextStyle_TEXTSTYLE);
I get a return code of -126 (invalid argument).
So how should one set the TextStyle?