|
void ShowDxfAndClassName()
{
const TCHAR *szTempPrompts[2]={_T("\n选择一个元素<退出>:"), _T("") };
ads_name ssEnt;
if (RTNORM != acedSSGet(_T(":$:S"), szTempPrompts, NULL, NULL, ssEnt))
return;
ads_name ent;
acedSSName(ssEnt, 0L, ent);
resbuf* pResbuf = acdbEntGet(ent);
resbuf* pNext = pResbuf;
for (; pNext != NULL; pNext=pNext->rbnext)
{
if (pNext->restype == 0)
{
acutPrintf(_T("\nDXF name:%s"), pNext->resval.rstring);
break;
}
}
AcDbObjectId idEnt;
acdbGetObjectId(idEnt, ent);
AcDbEntity *pEnt = NULL;
if (Acad::eOk == acdbOpenAcDbEntity(pEnt, idEnt, AcDb::kForWrite))
{
if (NULL != pEnt)
{
acutPrintf(_T("\nclassName:%s"), pEnt->isA()->name());
pEnt->close();
}
}
} |
|