zackary 发表于 2007-4-25 11:09:00

程序换到其他人的机器上画出的图全乱了

<p>请教(急):vs2003+objectARX开发的"三通"绘制程序,在我的机器上运行正常,换到其他人的机器上画出的图全乱了???</p><p>我的机器和其他机器均安装的AutoCAD2004中文版</p>

Andyhon 发表于 2007-4-25 14:02:00

<p>您给的是 Release 版还是 Debug 版?<br/>有否引用到需向系统注册的Dll或ocx元件?</p><p></p>

zackary 发表于 2007-4-26 09:09:00

禀告大侠,Relaese版和Debug版都试了,问题一样

<p>禀告大侠,Relaese版和Debug版都试了,问题一样。</p><p>没用过什么高级引用</p><p>源程序如下:</p><p>void draw_st()&nbsp;&nbsp;&nbsp; <br/>{<br/>&nbsp; ads_hdlg&nbsp; hdlg;&nbsp;&nbsp;&nbsp; //对话框的handle<br/>&nbsp; int&nbsp; dcl_id,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //对话框标识字<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dlg_status;&nbsp;&nbsp; //对话框的状态</p><p>&nbsp; struct resbuf rb;&nbsp; //供存取AutoCAD系统变量之用<br/>&nbsp; short sht1,sht2;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //对话框中幻灯片的尺寸<br/>&nbsp; ads_point pt,pt1,pt2,pt3,pt_temp1,pt_temp2;<br/>&nbsp; ads_real flyg,flk,zxxcg;//法兰缘高,法兰宽,中心线超高<br/>&nbsp; ads_name ent,ss,ent1,ent2,ent3;</p><p><br/>&nbsp; if(ads_load_dialog("st.dcl", &amp;dcl_id)!=RTNORM) {&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //将对话框文件set_env.dcl调入内存<br/>&nbsp;&nbsp;&nbsp; acedAlert("装入st.dcl文件出错.");<br/>&nbsp;&nbsp;&nbsp; return;<br/>&nbsp; }<br/>&nbsp; if(ads_new_dialog("draw_st",dcl_id,(CLIENTFUNC)0,&amp;hdlg)!=RTNORM) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //显示对话框,图10-1<br/>&nbsp;&nbsp;&nbsp; acedAlert("显示draw_st对话框时出错.");<br/>&nbsp;&nbsp;&nbsp; ads_unload_dialog(dcl_id);<br/>&nbsp;&nbsp;&nbsp; return;<br/>&nbsp; }</p><p>&nbsp; ads_dimensions_tile(hdlg,"image_st",&amp;sht1,&amp;sht2);&nbsp;&nbsp;&nbsp; //显示幻灯片<br/>&nbsp; ads_start_image(hdlg,"image_st");<br/>&nbsp; ads_slide_image(0,0,sht1,sht2,"stimage"); //幻灯片名为stimage<br/>&nbsp; ads_end_image();</p><p>&nbsp; ads_set_tile(hdlg,"Dia", "300");</p><p>&nbsp; ads_action_tile(hdlg, "accept", (CLIENTFUNC)xd_draw_st);&nbsp;&nbsp;</p><p>//由对话框返回直径Diameter和绘制类型draw_style<br/>&nbsp;&nbsp; ads_start_dialog(hdlg, &amp;dlg_status);&nbsp;&nbsp; //与对话框进行交互</p><p><br/>&nbsp; if(acedGetPoint(NULL,"\nPick a point:",pt)==RTNORM)<br/>&nbsp; {<br/>&nbsp;/*初始化工作环境*/</p><p>&nbsp;layer_do("M","FAT");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //创建线层<br/>&nbsp;layer_do("M","THIN");<br/>&nbsp;layer_do("M","CEN");<br/>&nbsp;layer_edit("C","WHITE","FAT");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //设定颜色<br/>&nbsp;layer_edit("C","WHITE","THIN");<br/>&nbsp;layer_edit("C","GREEN","CEN");<br/>&nbsp;layer_edit("L","CONTINUOUS","FAT");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //设定线型<br/>&nbsp;layer_edit("L","CONTINUOUS","THIN");<br/>&nbsp;layer_edit("L","CENTER","CEN");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;layer_edit("LW","0.3","FAT");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //设置线宽<br/>&nbsp;acedCommand(RTSTR,"LTSCALE",RTREAL,10.0,0);</p><p>&nbsp; }<br/>&nbsp; else<br/>&nbsp; {<br/>&nbsp;acedAlert("输入插入点错误.");<br/>&nbsp; }</p><p><br/>&nbsp; if(Diameter&gt;=200)<br/>&nbsp; { <br/>&nbsp;&nbsp; flyg=100;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zxxcg=150;<br/>&nbsp; }<br/>&nbsp; else<br/>&nbsp; {<br/>&nbsp;&nbsp; flyg=60;<br/>&nbsp;&nbsp; zxxcg=90;<br/>&nbsp; }<br/>&nbsp; flk=30;</p><p>&nbsp; if(draw_style=='1')<br/>&nbsp; {<br/>&nbsp;&nbsp;&nbsp;&nbsp; //计算主视图中各点坐标<br/>&nbsp; Spoint(pt1,pt,pt,pt);<br/>&nbsp; Spoint(pt1,pt1-flk,pt1+Diameter/2+flyg,pt1);<br/>&nbsp; Spoint(pt1,pt1+flk,pt1,pt1);<br/>&nbsp; Spoint(pt1,pt1+flk,pt1,pt1);<br/>&nbsp; Spoint(pt1,pt1-2*flk,pt1-Diameter-2*flyg,pt1);<br/>&nbsp; Spoint(pt1,pt1+flk,pt1,pt1);<br/>&nbsp; Spoint(pt1,pt1+flk,pt1,pt1);<br/>&nbsp; Spoint(pt1,pt1,pt1+Diameter+flyg,pt1);<br/>&nbsp; Spoint(pt1,pt1,pt1-Diameter,pt1);<br/>&nbsp; Spoint(pt1,pt1+3*Diameter/2-flk,pt1+Diameter+zxxcg,pt1);<br/>&nbsp; Spoint(pt1,pt1,pt1-zxxcg,pt1);<br/>&nbsp; Spoint(pt1,pt1,pt1-Diameter/2,pt1);<br/>&nbsp; Spoint(pt1,pt1-Diameter/2,pt1-Diameter/2,pt1);<br/>&nbsp; Spoint(pt1,pt1+Diameter/2,pt1,pt1);<br/>&nbsp; Spoint(pt1,pt1-Diameter/2,pt1-3*Diameter/2+flk,pt1);<br/>&nbsp; Spoint(pt1,pt1+Diameter/2,pt1,pt1);<br/>&nbsp; Spoint(pt1,pt1-Diameter/2-flyg,pt1,pt1);<br/>&nbsp; Spoint(pt1,pt1,pt1-flk,pt1);<br/>&nbsp; Spoint(pt1,pt1,pt1-flk,pt1);<br/>&nbsp; Spoint(pt1,pt1+Diameter/2+flyg,pt1+2*flk,pt1);<br/>&nbsp; Spoint(pt1,pt1,pt1-flk,pt1);<br/>&nbsp; Spoint(pt1,pt1,pt1-flk,pt1);</p><p>&nbsp;&nbsp; //绘制中心线<br/>&nbsp; layer_do("S","CEN");<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,NULL,ss);<br/>&nbsp; //绘制细实线<br/>&nbsp; layer_do("S","THIN");<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp;&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp;&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; //绘制粗实线<br/>&nbsp; layer_do("S","FAT");<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"LINE",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"",0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);<br/>&nbsp; acedCommand(RTSTR,"ARC",RTSTR,"C",RT3DPOINT,pt1,RT3DPOINT,pt1,RT3DPOINT,pt1,0);<br/>&nbsp; acdbEntLast(ent);<br/>&nbsp; acedSSAdd(ent,ss,ss);</p><p>&nbsp; //拷贝有半部分<br/>&nbsp; acedCommand(RTSTR,"MIRROR",RTPICKS,ss,RTSTR,"",RT3DPOINT,pt1,RT3DPOINT,pt1,RTSTR,"N",0);</p><p>&nbsp; }</p><p>&nbsp; else if(draw_style=='2')<br/>&nbsp; {</p><p>...<br/>&nbsp;&nbsp; }<br/>&nbsp; else<br/>&nbsp; {</p><p>...<br/>&nbsp;&nbsp; }</p><p><br/>&nbsp; ads_unload_dialog(dcl_id);&nbsp;&nbsp;&nbsp; //清理内存</p><p>&nbsp; acedGetVar("DIASTAT",&amp;rb);&nbsp;&nbsp;&nbsp; <br/>&nbsp; if(rb.resval.rint==0) {<br/>&nbsp;&nbsp;&nbsp; acedRetVoid();&nbsp;&nbsp;&nbsp; //直接返回AutoLISP,不回显nil<br/>&nbsp;&nbsp;&nbsp; return;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //CANCEL结束对话框,返回<br/>&nbsp; }</p>

zackary 发表于 2007-4-26 09:18:00

正常的图形和变形后图形

<p>我把正常的图形和变形后图形以图片形式上传,大侠帮忙看看</p>

zackary 发表于 2007-4-26 16:19:00

各位看官倒是给个意见呀

zackary 发表于 2007-4-27 11:03:00

<p>又试了一下,简直要疯了.</p><p>加载奔特力海思德的WaterCAD后 即发生变形,我该怎么办?这该死的程序倒底修改了什么设置?</p><p>加载奔特力海思德的WaterCAD后,作程序画一横线,正常。画一竖线也正常。横线竖线一起画就变形了。</p>

lilin 发表于 2007-4-29 09:22:00

<p>你程序中使用了命令,你肯定是把对象捕捉开启了,关闭即可!!!!</p>

zackary 发表于 2007-4-29 10:14:00

<p>问题已解决,果然是对象捕捉设置的问题。多谢大侠</p>
页: [1]
查看完整版本: 程序换到其他人的机器上画出的图全乱了