Adesk::Boolean cxDbEmbeddedEntity::subWorldDraw (AcGiWorldDraw *mode) {
//////////////////////////////////////////////////////////////////////////
// Следующие три определения могут быть на уровне класса
//////////////////////////////////////////////////////////////////////////
AcDbObjectId styleId = id().database()->textstyle();
AcString text = _T("Тест");
AcGePoint3d pRightCenter; // Ты знаешь точку правой границы.
//////////////////////////////////////////////////////////////////////////
assertReadEnabled () ;
AcGiTextStyle style;
// Получаем текстовый стиль
Acad::ErrorStatus es = fromAcDbTextStyle(style, styleId);
style.loadStyleRec();
//
if (es == Acad::eOk)
{
// setup the text
int length = -1;
// find out the extents
AcGePoint2d extMax,extMin;
if (Acad::eOk == style.extentsBox(text, false, length, false, extMin, extMax))
{
// Вычисляем точку вставки
AcGePoint3d insertionPnt = pRightCenter -
AcGeVector3d(extMax.x - extMin.x, (extMax.y - extMin.y)/2.0, 0);
mode->geometry().text(
insertionPnt, AcGeVector3d::kZAxis, AcGeVector3d::kXAxis, text, length, true, style);
}
return (AcDbEntity::subWorldDraw (mode)) ;
}