|
发表于 2003-5-22 19:40:00
|
显示全部楼层
使用acedInvoke()函数调用 AutoCAD ROTATE3D 命令.
ROTATE3D 命令是在geom3d.arx中定义的,使用acedDefun注册的外部命令,所以除了使用acedInvoke()函数调用外,不能使用acedCommand 调用.另外,你还必须要保证geom3d.arx加载,并且在你使用acedDefun()方法定义的函数内通过acedInvoke()调用它.不能在用acedRegCmds->addCommand()方法定义的命令内使用.
下面是示例代码:
code:--------------------------------------------------------------------------------
int testfunc()
{
// make sure that geom3d.arx is loaded
acedArxLoad("geom3d.arx");
ads_name pieces;
ads_point Point1, Point2;
Point1[X] = 1.0;
Point1[Y] = 1.0;
Point1[Z] = 0.0;
Point1[X] = 10.0;
Point1[Y] = 10.0;
Point1[Z] = 10.0;
ads_real Angle = 32;
//Select the entities you want to rotate
acedSSGet( NULL,NULL, NULL, NULL, pieces );
resbuf* pBuf = acutBuildList(RTSTR,"c:rotate3d", RTPICKS, pieces,
RTSTR, "", RT3DPOINT, Point1, RT3DPOINT, Point2, RTREAL, Angle,
RTNONE);
resbuf* result=NULL;
acedInvoke(pBuf,&result);
acutRelRb(pBuf);
if (result!=NULL)
acutRelRb(result);
return RTNORM;
} |
|