www.mxdraw.com
内容索引主面
前一个向上下一个
McDbDatabase::getAcDbObjectId 方法

给一个实体的名柄,返回实体的id,调用McDbObject::getAcDbHandle可以由实体id得到实体句柄

C++
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() );
    }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!