hjm1688 发表于 2004-3-18 13:10:00

明总这个程序在我实用中有启发,但我先要请教一个菜鸟问题:如何引用(加载)curve类(老出编译错误)?先谢过,盼回复!

ishou 发表于 2004-4-4 22:50:00

<FONT style="BACKGROUND-COLOR: #f7f709">'</FONT><A name=49930><FONT style="BACKGROUND-COLOR: #f7f709" color=#990000><B>myfreemind</B></FONT></A><FONT style="BACKGROUND-COLOR: #f7f709">: (3楼) </FONT>



<FONT style="BACKGROUND-COLOR: #f7f709">删除存在的选择集<BR>If ThisDrawing.SelectionSets.Count &gt; 0 Then<BR>                                                       For i = 0 To ThisDrawing.SelectionSets.Count - 1<BR>                                                       ThisDrawing.SelectionSets.<FONT color=#f70968>Item(i).</FONT>Clear<BR>                                                       ThisDrawing.SelectionSets.<FONT color=#ee1169>Item(i).</FONT>Delete<BR>                                                       Next<BR>End If</FONT>


--------------------


上面的 <FONT color=#dd2292>item (i)</FONT> 中的 <FONT color=#e61abd>i </FONT>好象 要改成 常数 <FONT color=#2222dd>0 </FONT>

efan2000 发表于 2004-4-5 12:30:00

使用For i = ThisDrawing.SelectionSets.Count - 1 To 0就不需要。

ishou 发表于 2004-4-5 18:48:00

<FONT face="Times New Roman" color=#000066 size=2><B><FONT style="BACKGROUND-COLOR: #ffff00" color=#f70909>efan2000:       (13楼)使用For i = ThisDrawing.SelectionSets.Count - 1 To 0就不需要。</FONT><BR>------------------------------------------</B></FONT>



<FONT face="Times New Roman" size=2></FONT>


<FONT face="Times New Roman" color=#1111ee size=2>这行程序码不能省!</FONT>

efan2000 发表于 2004-4-13 11:02:00

是这样的,删除集合时,会引起集合中的数目变化。


For i = 0 To ThisDrawing.SelectionSets.Count - 1<BR>               ThisDrawing.SelectionSets.Item(i).Clear<BR>               ThisDrawing.SelectionSets.Item(i).Delete<BR>Next


比如:本来集合中的数目是5个,删除1个之后只有4个了,但计数器i的循环次数依然没有改变,是从0-4的,因而后面的就会出错,因为已经不存在了。


For i = ThisDrawing.SelectionSets.Count - 1 To        0                                       ThisDrawing.SelectionSets.Item(i).Clear<BR>               ThisDrawing.SelectionSets.Item(i).Delete<BR>Next


计数器i的循环是从4-0的,所以没有影响。

无痕 发表于 2004-4-14 23:32:00

vl


用get-area属性,vlax-curve系列很容易解决

pfrynwgkq 发表于 2004-11-3 17:58:00

做建筑的正需要这个。。谢了。。

兰州人 发表于 2007-12-8 21:53:00

mccad发表于2003-10-29 22:57:00static/image/common/back.gif注意程序需要加载VLAX类和CURVE类程序处理过程调用了(gc)来强制释放内存,不然会出错。Sub GetTolArea()&nbsp;&nbsp;&nbsp;&nbsp;ThisDrawing.SendCommand \"(vl-load-com)\" &amp; vbCr&nbsp;

<p>此帖子必要认真研究一下。</p>

aa2567 发表于 2008-1-19 17:29:00

<p>这个程序太好了,可以解决实际问题,如果再改进一点就更好了,</p><p>如果点在空处会出错,我真傻,明摆着要点框,我却去框选。</p><p>实际应用中,如果要多次框选,如何修改?</p>

wr_9 发表于 2008-7-10 09:48:00

求命令?

<p>已经加载,但是如何调用命令呢?</p><p></p>
页: 1 [2] 3
查看完整版本: 如何编写VBA求解多个不规则封闭图形的总面积,总周长,个数?