kinglau 发表于 2006-3-2 16:24:00

指点~~为什么没结果

<P>怎么没的结果呢<BR>Sub lr()<BR>Dim Selects As AcadSelectionSet<BR>Dim FType(0) As Integer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '选择过滤器的类型代码<BR>Dim FData(0) As Variant&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' 选择过滤器的值<BR>Dim entity As AcadEntity<BR>Dim L, r As Integer<BR><BR>FType(0) = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '&nbsp;FData(0) = "Line,Arc"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<P>' ' 选择图元<BR>Set Selects = ThisDrawing.SelectionSets.Add("lr4")<BR>Selects.SelectOnScreen FType, FData<BR>For Each entity In Selects<BR>&nbsp;If EntityName = "acdbline" Then L = L + 1<BR>&nbsp;If EntityName = "acdbarc" Then r = r + 1<BR>&nbsp;Next<BR>&nbsp;MsgBox L, r<BR>&nbsp;Selects.Delete</P>
<P><BR>End Sub<BR></P>

雪山飞狐_lzh 发表于 2006-3-2 18:21:00

For Each entity In Selects
If ucase(entity.ObjectName) = "ACDBLINE" Then
L = L + 1
else
r = r + 1
end if
Next

kinglau 发表于 2006-3-3 21:29:00

谢谢了啊~~~
页: [1]
查看完整版本: 指点~~为什么没结果