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