www.mxdraw.com
|
给一个实体的名柄,返回实体的id,调用McDbObject::getAcDbHandle可以由实体id得到实体句柄
Mcad::ErrorStatus getAcDbObjectId(McDbObjectId& retId, bool createIfNotFound, const McDbHandle& objHandle, Mdesk::UInt32 xRefId = 0);
参数 |
说明 |
McDbObjectId& retId |
返回实体的id |
bool createIfNotFound |
暂没有使用 |
const McDbHandle& objHandle |
传入的实体名柄 |
Mdesk::UInt32 xRefId = 0 |
暂没有使用 |
如果成功返回Mcad::eOk,如果传递的数据非法则返回Mcad::eInvalidInput
AcDbHandle handle(_T("1A388")); AcDbObjectId retId; acdbHostApplicationServices()->workingDatabase()->getAcDbObjectId(retId,false,handle); AcDbObjectPointer<AcDbObject> spObj(retId,AcDb::kForRead); if(spObj.openStatus() == Acad::eOk) { acutPrintf(spObj->isA()->name() ); }