贴一段代码给你参考:
- int MyTest()
- {
- struct resbuf *rb = acedGetArgs();
- double x=0;
- short rbType;
- while (rb!=NULL)
- {
- rbType =rb->restype;
- switch(rbType)
- {
- case RTSHORT:
- x+=rb->resval.rint;
- break;
- case RTLONG:
- x+=rb->resval.rlong;
- break;
- case RTREAL:
- x+=rb->resval.rreal;
- break;
- default:
- acdbFail(_T("参数应当为实数!"));
- return RSERR;
- }
- rb=rb->rbnext;
- }
- acedRetReal(x);
- return RSRSLT;
- }
|