- 积分
- 455
- 明经币
- 个
- 注册时间
- 2003-4-1
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
void addxdata()
{
AcDbObject *pObj;
ads_name ent;
ads_point ptpoint;
if(acedEntSel("\nSelect entity. ", ent, ptpoint)!=RTNORM)
{
acutPrintf("\nnothing selected!!");
return;
}
AcDbObjectId obId;
acdbGetObjectId(obId,ent);
acdbOpenObject(pObj,obId, AcDb::kForRead);
int m=9;
struct resbuf *pRb,*pTemp;
pRb=pObj->xData("yd1");
if(pRb!=NULL)
{
acutPrintf("\n已经有护展数据");
for(pTemp=pRb;pTemp->rbnext!=NULL;pTemp=pTemp->rbnext)
{;}
}
else
{
if(acdbTblSearch("APPID","yd1",0)==NULL)
acdbRegApp("yd1");
else
{
pObj->close();
}
pRb=acutNewRb(AcDb::kDxfRegAppName);
pRb->resval.rstring="yd1";
}
pRb->rbnext=acutNewRb(AcDb::kDxfXdInteger16);
pRb->resval.rint=m;
pObj->upgradeOpen();
pObj->setXData(pRb);
pObj->close();
acutRelRb(pRb);
} |
|