[求助][VBA]关于选择集
<P>Dim filterType1(1) As Integer, filterDate1(1) As Variant </P><P>Dim SsetObj As AcadSelectionSet</P>
<P><BR>filterType1(0) = 0<BR>filterDate1(0) = "Text"<BR>filterType1(1) = 8<BR>filterDate1(1) = LayName</P>
<P>Set SsetObj = ThisDrawing.SelectionSets.Add("WenBen")</P>
<P>SsetObj.Select acSelectionSetAll, , , filterType1, filterDate1</P>
<P>Debug.Print SsetObj.Count</P>
<P>SsetObj.Delete</P>
<P>我想统计指定图层上有多少文本,按照上面的程序,总是显示是0,不知哪里不对,请高手指点</P> <P>你的图曾名是什么呢?就是"LayName"</P>
<P>那试试这样:</P>
<P>filterDate1(1) = "LayName"</P> LayName 是一个变量,获取不同的图层名。 <P>解决了</P>
<P> Dim FilterType1(3) As Integer, FiLterData1(3) As Variant</P>
<P> FilterType1(0) = -4<BR> FiLterData1(0) = "<or"<BR> FilterType1(1) = 0<BR> FiLterData1(1) = "Text"<BR> FilterType1(2) = 8<BR> FiLterData1(2) = LayName<BR> FilterType1(3) = -4<BR> FiLterData1(3) = "or>"</P>
<P>Set SsetObj = ThisDrawing.SelectionSets.Add("WenBen")</P>
<P>SsetObj.Select acSelectionSetAll, , , filterType1, filterDate1</P>
<P>Debug.Print SsetObj.Count</P>
<P>SsetObj.Delete</P> <P>不对,还是出不来,请高手指点</P> <P>你的第一个程序没有问题的</P> <P><BR> Dim FilterType1(1) As Integer, FiLterData1(1) As Variant</P>
<P><BR> FilterType1(0) = 0<BR> FiLterData1(0) = "Text"<BR> FilterType1(1) = 8<BR> FiLterData1(1) = "LayName"</P>
<P><BR> Dim ssetobj As AcadSelectionSet</P>
<P>Set ssetobj = ThisDrawing.SelectionSets.Add("wenben")<BR>ssetobj.Select acSelectionSetAll, , , FilterType1, FiLterData1<BR>Debug.Print ssetobj.Count</P>
<P>ssetobj.Delete<BR><BR>注意华横线部分</P> <P>第一个好像是没问题,可能脑袋有点晕了。呵呵~</P>
<P>想再请教一个问题,图层上有单行和多行文字,同时要统计出来,哪该怎么写程序啊?</P> 建两个选择集,FiLterData1(0) = "MText"再统计一遍 mayuezxl发表于2006-8-18 14:58:00static/image/common/back.gif第一个好像是没问题,可能脑袋有点晕了。呵呵~
想再请教一个问题,图层上有单行和多行文字,同时要统计出来,哪该怎么写程序啊?
<BR>
页:
[1]