请教
各位大侠:你们好!
我用acedCommand命令画线。但怎么执行时出现了异常。
void DrawL()
{
AcGePoint3d pt,pt1,pt2,pt3,pt4,pt5,pt6,pt7,pt8;
acedGetPoint(NULL,"Please select insert point:",asDblArray(pt));
pt1=pt;
pt1=pt;
pt2=pt1;
pt2=pt1+10;
pt3=pt2-5;
pt3=pt2;
pt4=pt3;
pt4=pt3+10;
pt5=pt4+20;
pt5=pt4;
pt6=pt5;
pt6=pt5-10;
pt7=pt6-5;
pt7=pt6;
pt8=pt7;
pt8=pt7-10;
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt2,RT3DPOINT,pt3,RT3DPOINT,pt4,RT3DPOINT,pt5,RT3DPOINT,pt6,RT3DPOINT,pt7,RT3DPOINT,pt8,RT3DPOINT,pt1,0);
}
谢谢。。 我个人很少用acedCommand()函数,但是你混用了ARX和ADS的东西,把AcGePoint3d类型的变量换成ads_point试试,另外,最好把X、Y和Z都进行初始化。 谢谢版主。我改了下就可以了。
void DrawL()
{
ads_point pt,pt1,pt2,pt3,pt4,pt5,pt6,pt7,pt8;
acedGetPoint(NULL,"Please select insert point:",pt);
pt1=pt;
pt1=pt;
pt2=pt1;
pt2=pt1+10;
pt3=pt2-5;
pt3=pt2;
pt4=pt3;
pt4=pt3+10;
pt5=pt4+20;
pt5=pt4;
pt6=pt5;
pt6=pt5-10;
pt7=pt6-5;
pt7=pt6;
pt8=pt7;
pt8=pt7-10;
acedCommand(RTSTR,"LINE",RTPOINT,pt1,RTPOINT,pt2,RTPOINT,pt3,RTPOINT,pt4,RTPOINT,pt5,RTPOINT,pt6,RTPOINT,pt7,RTPOINT,pt8,RTSTR,"C",0);
} 加上关闭捕捉模式会好些
acedCommand(RTSTR, "OSMODE", RTSTR, "0", RTNONE); 在ARX中少用acedCommand
页:
[1]