程序换到其他人的机器上画出的图全乱了
请教(急):vs2003+objectARX开发的"三通"绘制程序,在我的机器上运行正常,换到其他人的机器上画出的图全乱了???我的机器和其他机器均安装的2004中文版
您给的是 Release 版还是 Debug 版?
有否引用到需向系统注册的Dll或ocx元件?
禀告大侠,Relaese版和Debug版都试了,问题一样。
没用过什么高级引用
源程序如下:
void draw_st()
{
ads_hdlghdlg; //对话框的handle
intdcl_id, //对话框标识字
dlg_status; //对话框的状态
struct resbuf rb;//供存取AutoCAD系统变量之用
short sht1,sht2; //对话框中幻灯片的尺寸
ads_point pt,pt1,pt2,pt3,pt_temp1,pt_temp2;
ads_real flyg,flk,zxxcg;//法兰缘高,法兰宽,中心线超高
ads_name ent,ss,ent1,ent2,ent3;
if(ads_load_dialog("st.dcl", &dcl_id)!=RTNORM) {
//将对话框文件set_env.dcl调入内存
acedAlert("装入st.dcl文件出错.");
return;
}
if(ads_new_dialog("draw_st",dcl_id,(CLIENTFUNC)0,&hdlg)!=RTNORM) {
//显示对话框,图10-1
acedAlert("显示draw_st对话框时出错.");
ads_unload_dialog(dcl_id);
return;
}
ads_dimensions_tile(hdlg,"image_st",&sht1,&sht2); //显示幻灯片
ads_start_image(hdlg,"image_st");
ads_slide_image(0,0,sht1,sht2,"stimage"); //幻灯片名为stimage
ads_end_image();
ads_set_tile(hdlg,"Dia", "300");
ads_action_tile(hdlg, "accept", (CLIENTFUNC)xd_draw_st);
//由对话框返回直径Diameter和绘制类型draw_style
ads_start_dialog(hdlg, &dlg_status); //与对话框进行交互
if(acedGetPoint(NULL,"\nPick a point:",pt)==RTNORM)
{
/*初始化工作环境*/
layer_do("M","FAT"); //创建线层
layer_do("M","THIN");
layer_do("M","CEN");
layer_edit("C","WHITE","FAT"); //设定颜色
layer_edit("C","WHITE","THIN");
layer_edit("C","GREEN","CEN");
layer_edit("L","CONTINUOUS","FAT"); //设定线型
layer_edit("L","CONTINUOUS","THIN");
layer_edit("L","CENTER","CEN");
layer_edit("LW","0.3","FAT"); //设置线宽
acedCommand(RTSTR,"LTSCALE",RTREAL,10.0,0);
}
else
{
acedAlert("输入插入点错误.");
}
if(Diameter>=200)
{
flyg=100;
zxxcg=150;
}
else
{
flyg=60;
zxxcg=90;
}
flk=30;
if(draw_style=='1')
{
//计算主视图中各点坐标
Spoint(pt1,pt,pt,pt);
Spoint(pt1,pt1-flk,pt1+Diameter/2+flyg,pt1);
Spoint(pt1,pt1+flk,pt1,pt1);
Spoint(pt1,pt1+flk,pt1,pt1);
Spoint(pt1,pt1-2*flk,pt1-Diameter-2*flyg,pt1);
Spoint(pt1,pt1+flk,pt1,pt1);
Spoint(pt1,pt1+flk,pt1,pt1);
Spoint(pt1,pt1,pt1+Diameter+flyg,pt1);
Spoint(pt1,pt1,pt1-Diameter,pt1);
Spoint(pt1,pt1+3*Diameter/2-flk,pt1+Diameter+zxxcg,pt1);
Spoint(pt1,pt1,pt1-zxxcg,pt1);
Spoint(pt1,pt1,pt1-Diameter/2,pt1);
Spoint(pt1,pt1-Diameter/2,pt1-Diameter/2,pt1);
Spoint(pt1,pt1+Diameter/2,pt1,pt1);
Spoint(pt1,pt1-Diameter/2,pt1-3*Diameter/2+flk,pt1);
Spoint(pt1,pt1+Diameter/2,pt1,pt1);
Spoint(pt1,pt1-Diameter/2-flyg,pt1,pt1);
Spoint(pt1,pt1,pt1-flk,pt1);
Spoint(pt1,pt1,pt1-flk,pt1);
Spoint(pt1,pt1+Diameter/2+flyg,pt1+2*flk,pt1);
Spoint(pt1,pt1,pt1-flk,pt1);
Spoint(pt1,pt1,pt1-flk,pt1);
//绘制中心线
layer_do("S","CEN");
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,NULL,ss);
//绘制细实线
layer_do("S","THIN");
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
//绘制粗实线
layer_do("S","FAT");
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
acedCommand(RTSTR,"ARC",RTSTR,"C",RT3DPOINT,pt1,RT3DPOINT,pt1,RT3DPOINT,pt1,0);
acdbEntLast(ent);
acedSSAdd(ent,ss,ss);
//拷贝有半部分
acedCommand(RTSTR,"MIRROR",RTPICKS,ss,RTSTR,"",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"N",0);
}
else if(draw_style=='2')
{
...
}
else
{
...
}
ads_unload_dialog(dcl_id); //清理内存
acedGetVar("DIASTAT",&rb);
if(rb.resval.rint==0) {
acedRetVoid(); //直接返回AutoLISP,不回显nil
return; //CANCEL结束对话框,返回
}
我把正常的图形和变形后图形以图片形式上传,大侠帮忙看看
各位看官倒是给个意见呀 又试了一下,简直要疯了.
加载奔特力海思德的WaterCAD后 即发生变形,我该怎么办?这该死的程序倒底修改了什么设置?
加载奔特力海思德的WaterCAD后,作程序画一横线,正常。画一竖线也正常。横线竖线一起画就变形了。
你程序中使用了命令,你肯定是把对象捕捉开启了,关闭即可!!!!
问题已解决,果然是对象捕捉设置的问题。多谢大侠
页:
[1]