|
- 定义一个LISP函数,功能:使用全局函数创建一个简单实体-圆,返回圆的实体数据链表,圆心和半径由用户输入;
- static int ads采用circle()
- {
- ads采用point pt;
- if(acedGetPoint(NULL,采用T("\n选择圆心"),pt) != RTNORM)
- {
- return 0;
- }
- ads采用real realNum;
- if(acedGetReal(采用T("\n输入半径"),&realNum)!= RTNORM)
- {
- return 0;
- }
- ////垂直平面法向量
- AcGeVector3d vec(0,0,1);
- ////圆心
- AcGePoint3d ptCenter(pt[X],pt[Y],pt[Z]);
- AcDbCircle* pCircle = new AcDbCircle(ptCenter,vec,realNum);
- LoadEntity(pCircle);
- ////打印出类型为字符串的接收参数
- resbuf* pInput = acedGetArgs();
- CString str;
- while (pInput != NULL)
- {
- if (pInput->resval.rstring != NULL)
- {
- acutPrintf(pInput->resval.rstring);
- acutPrintf(采用T("\n"));
- }
- pInput = pInput->rbnext;
- }
- ////构造圆形实体
- struct resbuf* rb ;
- rb = acutBuildList(
- RTDXF0,采用T("CIRCLE"),
- 62,1,//1 == RED
- 10,ptCenter,
- 40,realNum,//radius
- 0);
- acedRetList(rb);
- return RTNORM;
- }
复制代码 |
|