There are several global utility functions available to copy text style data from an AcDbTextStyleTableRecord to an AcGiTextStyle, and vice versa. The following functions use the object ID of the AcDbTextStyleTableRecord and a reference to the AcGiTextStyle to identify the two objects involved:
Acad::ErrorStatus fromAcDbTextStyle( AcGiTextStyle& textStyle, const AcDbObjectId& AcDbStyleId); Acad::ErrorStatus toAcDbTextStyle( const AcDbObjectId AcDbStyleId, AcGiTextStyle& textStyle);
The following functions make use of the AcGiTextStyle and AcDbTextStyleTableRecord names:
Acad::ErrorStatus fromAcDbTextStyle( AcGiTextStyle& textStyle, const char* AcDbStyleName); Acad::ErrorStatus toAcDbTextStyle( AcGiTextStyle& textStyle); Acad::ErrorStatus toAcDbTextStyle( AcGiTextStyle& textStyle, const char* AcDbStyleName);
When copying data to or from an AcDbTextStyleTableRecord that has been specified by name, the AcGiTextStyle object's name is set to match the name of the AcDbTextStyleTableRecord. If no record is found when copying to an AcDbTextStyleTableRecord specified by name, then one is created.
When copying from an AcGiTextStyle to an AcDbTextStyleTableRecord and the name of the AcGiTextStyle is used as the name of the AcDbTextStyleTableRecord, if the AcGiTextStyle does not have a name, a unique name is generated and used as the name for the AcGiTextStyle and AcDbTextStyleTableRecord objects.
The following functions are similar to the previous functions, except that they have an AcDbObjectId argument used for the objectId of the AcDbTextStyleTableRecord that the data has been copied into.
Acad::ErrorStatus toAcDbTextStyle( AcGiTextStyle& textStyle, AcDbObjectId& AcDbStyleId); Acad::ErrorStatus toAcDbTextStyle( AcGiTextStyle& textStyle, const char* AcDbStyleName, AcDbObjectId& AcDbStyleId);