BDYCAD 发表于 2007-4-8 16:29:00

[请教]在ARX上acdbEntGet 取到的DXF组码没有颜色62的, 要怎么加上这62颜色组码呀?

<p>因为在CAD里面对象的颜色如果是随层,DXF组码里面就没有记录该对象颜色的组码,请问在ARX里面怎么加上呀?<br/>我的测试代码如下: 还望各位朋友在百忙中抽点时间指点下,谢谢</p><p>static int ads_modlast(void)<br/>{<br/>&nbsp;//----- Remove the following line if you do not expect any argument for this ADS function<br/>&nbsp;struct resbuf *pArgs =acedGetArgs () ,*ed,*cb;<br/>&nbsp;// TODO: add your code here<br/>&nbsp;int a=0;<br/>&nbsp;ads_name en;<br/>&nbsp;acdbEntLast(en);<br/>&nbsp;ed= acdbEntGet(en);<br/>&nbsp;for(cb=ed;cb!=NULL;cb=cb-&gt;rbnext)<br/>&nbsp;{<br/>&nbsp;&nbsp;if(cb-&gt;restype== 62)<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;cb-&gt;resval.rint=1;//我想把对象改为红色<br/>&nbsp;&nbsp;&nbsp;if(acdbEntMod(ed)!=RTNORM)<br/>&nbsp;&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;&nbsp;acutRelRb(ed);<br/>&nbsp;&nbsp;&nbsp;&nbsp;return 0;<br/>&nbsp;&nbsp;&nbsp;}<br/>&nbsp;&nbsp;&nbsp;a=1;<br/>&nbsp;&nbsp;&nbsp;break;//处理好就跳出循环,节省时间。<br/>&nbsp;&nbsp;}<br/>&nbsp;}<br/>&nbsp;if(a==0)//这个变量告诉我该对象的颜色随层,DXF里面没有颜色的组面要加上去,<br/>&nbsp;&nbsp;//但是我加的不对,要怎么做才对呢?请教各位朋友.<br/>&nbsp;{<br/>&nbsp;&nbsp;ed-&gt;restype=62;<br/>&nbsp;&nbsp;ed-&gt;resval.rint=1;<br/>&nbsp;&nbsp;acdbEntMod(ed);<br/>&nbsp;}<br/>&nbsp;acutPrintf("\n变量A的值为&lt;%d&gt;;",a);<br/>&nbsp;acutRelRb(ed);<br/>&nbsp;// TODO: Replace the following line by your returned value if any<br/>&nbsp;acedRetVoid () ;</p><p>&nbsp;return (RSRSLT) ;<br/>}</p><p></p>

huihuo 发表于 2007-4-8 17:07:00

本帖最后由 作者 于 2007-4-8 17:08:27 编辑 <br /><br /> <p>用acutNewRb和acedEntMod</p>
页: [1]
查看完整版本: [请教]在ARX上acdbEntGet 取到的DXF组码没有颜色62的, 要怎么加上这62颜色组码呀?