|
- 定义一个全局命令,功能:使用全局函数创建一个简单实体-直线,顶点由用户输入;
- static void TESTlineCmd()
- {
- ads采用point inputStart;
- ads采用point inputEnd;
- AcGePoint3d ptStart;
- AcGePoint3d ptEnd;
- ////用户输入要画的坐标
- if (acedGetPoint(NULL,采用T("\nstart point"),inputStart) != RTNORM)
- {
- return;
- }
- ptStart[X] = inputStart[X];
- ptStart[Y] = inputStart[Y];
- ptStart[Z] = inputStart[Z];
- if (acedGetPoint(NULL,采用T("\nend point"),inputEnd) != RTNORM)
- {
- return;
- }
- ptEnd[X] = inputEnd[X];
- ptEnd[Y] = inputEnd[Y];
- ptEnd[Z] = inputEnd[Z];
- AcDbLine* pLine = new AcDbLine(ptStart,ptEnd);
- int colorIndex = SelColor();
- AcCmColor color;
- color.setColorIndex(colorIndex);
- pLine->setColor(color);
- LoadEntity(pLine);
- }
复制代码 |
|