|
//功能:得到快参照名称
CString GetBlkName(AcDbEntity* pEnt);
CString CZzzBlock::GetBlkName(AcDbEntity* pEnt)
{
CString strBlkName;
AcDbBlockReference* pBlock = AcDbBlockReference::cast(pEnt);
AcDbObjectId idBlkDef = pBlock->blockTableRecord();
AcDbBlockTableRecordPointer pBlkTblRcd(idBlkDef, AcDb::kForRead);
if (Acad::eOk != pBlkTblRcd.openStatus())
return strBlkName;
TCHAR* szName = NULL;
pBlkTblRcd->getName(szName);
strBlkName = szName;
return strBlkName;
} |
|