- UID
- 186670
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-10-24
- 最后登录
- 1970-1-1
|
发表于 2006-5-7 11:59:06
|
显示全部楼层
use the "getAt()" function
////////////////////////////////////////
Acad::ErrorStatus
getAt(
const char* entryName,
AcDbObjectId& recordId,
bool getErasedRecord = false) const;
entryName Input name of record to search for
recordId Returns with object ID of record with name entryName
getErasedRecord Input bool indicating whether or not to find an erased record
This function searches the DimStyleTable for the record with name entryName and, if found, returns the AcDbObjectId of the record in recordId. If getErasedRecord==true, then matches against erased records are possible.
Possible return ErrorStatus codes are: Acad::eOk, Acad::eKeyNotFound, or Acad::ePermanentlyErased.
///////////////////////////////////////////////////////////////
void test()
{
// TODO: Implement the command
AcDbDimStyleTable *pDimStyleTable;
Acad::ErrorStatus es;
es=acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pDimStyleTable,AcDb::kForRead);
if(es!=Acad::eOk)
return;
AcDbObjectId dId;
pDimStyleTable->getAt("STANDARD",dId);
pDimStyleTable->close();
acutPrintf("\nThe Object's Id= %d",dId);
} |
|