AcDbText( const AcGePoint3d& position, const ACHAR* text, AcDbObjectId style = AcDbObjectId::kNull, double height = 0, double rotation = 0 );
Parameters
|
Description
|
const AcGePoint3d& position
|
Input insertion point for the text
|
const ACHAR* text
|
Input text string to be used as displayed text.
|
AcDbObjectId style = AcDbObjectId::kNull
|
Input object ID of the
AcDbTextStyleTableRecord to use
|
double height = 0
|
Input height of the shape
|
double rotation = 0
|
Input
rotation angle (in radians) for the text about its OCS Z axis
|
AcGePoint3d ptSart(0,0,0);
AcDbText *pTextEntity = new AcDbText(ptSart,_T("你好啊"),AcDbObjectId::kNull,100,0);
if (pTextEntity == NULL)
return;
//将实体添加到模型空间是固定的代码,
AcDbDatabase* pDb = NULL;
pDb = acdbHostApplicationServices()->workingDatabase();
if (pDb == NULL)
return ;
AcDbBlockTable * pBlkTable ;
if(pDb->getBlockTable(pBlkTable , AcDb::kForRead) != Acad::eOk )
return ;
AcDbBlockTableRecord * pRec ;
if(pBlkTable->getAt(ACDB_MODEL_SPACE , pRec , AcDb::kForWrite) != Acad::eOk)
return ;
pBlkTable->close();
AcDbObjectId objId = AcDbObjectId::kNull;
if(pRec->appendAcDbEntity(objId, pTextEntity) != Acad::eOk) //将线添加到dwg中
return ;
pTextEntity->close() ;
pRec->close() ;
AcDbText *pTextEntity = new AcDbText(ptSart,_T("你好啊"),AcDbObjectId::kNull,100,0);
if (pTextEntity == NULL)
return;
//将实体添加到模型空间是固定的代码,
AcDbDatabase* pDb = NULL;
pDb = acdbHostApplicationServices()->workingDatabase();
if (pDb == NULL)
return ;
AcDbBlockTable * pBlkTable ;
if(pDb->getBlockTable(pBlkTable , AcDb::kForRead) != Acad::eOk )
return ;
AcDbBlockTableRecord * pRec ;
if(pBlkTable->getAt(ACDB_MODEL_SPACE , pRec , AcDb::kForWrite) != Acad::eOk)
return ;
pBlkTable->close();
AcDbObjectId objId = AcDbObjectId::kNull;
if(pRec->appendAcDbEntity(objId, pTextEntity) != Acad::eOk) //将线添加到dwg中
return ;
pTextEntity->close() ;
pRec->close() ;