- 积分
- 12459
- 明经币
- 个
- 注册时间
- 2003-5-28
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-9-25 12:06:00
|
显示全部楼层
回复
试过了,
rbTrav->rbnext = newRb; //rbTrav->rbnext = acutBuildList(RTPOINT, pick, RTNONE);
两种写法都可以,
//rbTrav->rbnext = NULL; 一句似乎也没起什么作用,
还是以前的建立链表代码有问题.
更改后的代码: // ----- asdkDynRb._DYNRB command (do not rename) static void asdkDynRb_DYNRB(void) { // Add your code for command asdkDynRb._DYNRB here ads_point firstpt, pick, lastpt; int nRet; ads_name ss; struct resbuf *ptList = NULL; struct resbuf *rbTrav ; Adesk::Boolean keepPicking = Adesk::kTrue; Adesk::Boolean firstPick = Adesk::kTrue; while (keepPicking) { if (firstPick) { nRet = acedGetPoint(NULL, "\nPick first point: ", pick); acdbPointSet(pick, firstpt); firstPick = Adesk::kFalse; ptList = acutBuildList(RTPOINT, pick, RTNONE); rbTrav = ptList; } else { acdbPointSet(pick, lastpt); nRet = acedGetPoint(pick, "\nPick next point - [ENTER] for exit: ", pick); if (nRet != RTNORM) { acedGrDraw(lastpt, firstpt, 1, 0); keepPicking = Adesk::kFalse; break; } acedGrDraw(lastpt, pick, 1, 0); rbTrav->rbnext = acutBuildList(RTPOINT, pick, RTNONE); rbTrav = rbTrav->rbnext; } }// while // Clear out the grdraw drawn vectors //acedRedraw(NULL, 1); nRet = acedSSGet("CP", ptList, NULL, NULL, ss); if (nRet == RTNORM) { long nEnts; nRet = acedSSLength(ss, &nEnts); if (nRet == RTNORM) { CString str; str.Format("%d", nEnts); acedAlert(str); for (int i = 0; i < nEnts; i++) { ads_name eName; acedSSName(ss, i, eName); AcDbObjectId id; acdbGetObjectId(id, eName); AcDbObjectPointer<AcDbEntity> ent (id, AcDb::kForRead); if (ent.openStatus() == Acad::eOk) { ent->highlight(); } } } } else acedAlert("选择失败"); if (ss) acedSSFree(ss); }
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|