- 积分
- 12459
- 明经币
- 个
- 注册时间
- 2003-5-28
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-9-24 22:14:00
|
显示全部楼层
试验不成功
本帖最后由 作者 于 2004-9-24 23:00:06 编辑
帮我找找原因:
// ----- asdkDynRb._DYNRB command (do not rename) static void asdkDynRb_DYNRB(void) { // Add your code for command asdkDynRb._DYNRB here ads_point pick, lastpt; int nRet; ads_name ss; struct resbuf *ptList = NULL; struct resbuf *rbTrav ; struct resbuf *newRb; Adesk::Boolean keepPicking = Adesk::kTrue; Adesk::Boolean firstPick = Adesk::kTrue;
while (keepPicking) { if (firstPick) { nRet = acedGetPoint(NULL, "\nPick first point: ", pick); firstPick = Adesk::kFalse;
newRb = acutNewRb(RTPOINT); newRb->resval.rpoint[0] = pick[0]; newRb->resval.rpoint[1] = pick[1]; newRb->resval.rpoint[2] = pick[2]; ptList = newRb; rbTrav = newRb; //if (newRb) // acutRelRb(newRb); } else { acdbPointSet(pick, lastpt); nRet = acedGetPoint(pick, "\nPick next point - [ENTER] for exit: ", pick); acedGrDraw(lastpt, pick, 1, 0);
newRb = acutNewRb(RTPOINT); newRb->resval.rpoint[0] = pick[0]; newRb->resval.rpoint[1] = pick[1]; newRb->resval.rpoint[2] = pick[2]; rbTrav->rbnext = newRb; rbTrav = rbTrav->rbnext; //if (newRb) // acutRelRb(newRb); } if (nRet != RTNORM) { keepPicking = Adesk::kFalse; break; }
}// while // Clear out the grdraw drawn vectors //acedRedraw(NULL, 1);
//newRb = acutNewRb(RTNONE); ////rbTrav = rbTrav->rbnext; ////rbTrav = newRb; //rbTrav->rbnext = newRb; //rbTrav = rbTrav->rbnext; rbTrav->rbnext = NULL; //rbTrav = ptList;
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); AcDbEntity *pEnt; acdbOpenAcDbEntity(pEnt, id, AcDb::kForRead); pEnt->highlight(); pEnt->close(); } } } else acedAlert("选择失败"); } |
|