单行文字类型
class McDbText : public McDbEntity;
dbents.h
例如:中中对齐绘制文字例程
AcDbObjectId CDrawTable::AddToModelSpace(AcDbEntity* pEntity,AcDbDatabase* pDatabase) { AcDbObjectId objId; AcDbBlockTableRecordPointer spBlkRec(ACDB_MODEL_SPACE,pDatabase,AcDb::kForWrite); if(spBlkRec.openStatus() != Acad::eOk) return AcDbObjectId::kNull; spBlkRec->appendAcDbEntity(objId, pEntity); pEntity->close(); return objId; } AcDbObjectId CDrawTable::DrawMCText(AcGePoint3d pt,const CString& sTxt,double dTextHeight,AcDbDatabase* pDatabase) { AcDbText *pText = NULL; pText = new AcDbText; pText->setHorizontalMode(AcDb::kTextCenter); pText->setVerticalMode(AcDb::kTextVertMid); pText->setPosition(pt); pText->setAlignmentPoint(pt); pText->setTextString(sTxt); pText->setHeight(dTextHeight ); pText->setColorIndex(MrxDbgUtils::kGreen); return AddToModelSpace(pText,pDatabase); }