[求助]选择集始终为空的问题
求助为何我使用SelectByPolygon acSelectionSetWindowPolygon所得到的选择集始终为空呢?<br/><br/>Public Sub click3(ByVal PickPoint As Variant)<br/><br/>Dim ss As AcadSelectionSet<br/>Set ss = CreateSelectionSet("ModSet")<br/><br/>Dim i As Integer<br/>Dim k As Integer<br/>Dim j As Integer<br/><br/>Dim pickpt As Variant<br/>On Error Resume Next<br/> <br/>ss.SelectAtPoint PickPoint<br/>Dim disptxt As String<br/><br/>If ss.Count > 0 Then<br/> If LCase(ss.Item(0).ObjectName) = LCase("AcDbpolyline") Then<br/> <br/>Dim gpnt As Variant<br/>gpnt = ss.Item(0).Coordinates<br/>Dim abc(3) As Double<br/>abc(0) = 0<br/>abc(1) = 1<br/>abc(2) = 2<br/>abc(3) = 3<br/>Dim sss As AcadSelectionSet<br/>Set sss = CreateSelectionSet("rico")<br/><br/>sss.SelectByPolygon acSelectionSetWindowPolygon, gpnt(abc(0))<br/>If sss.Count <> 0 Then<br/>MsgBox disptxt, , "123"<br/>End If<br/><br/> End If<br/>End If<br/><br/>End Sub<br/><br/>那个sss.count一直是0,所以msgbox disptxt,,“123”语句一直无法执行,求解答,谢谢。<br/> <p>注意查看两点:</p><p>1.gpnt = ss.Item(0).Coordinates取得的点表是不是都在当前视口内,如果存在点在当前视口外,SelectByPolygon方法选不到目标;</p><p>2.gpnt = ss.Item(0).Coordinates取得的点表是不是规范的,如果存在重合的点或所在多边形存在自相交等情况,SelectByPolygon也方法选不到目标;</p> <p> 没有定义fType, fData</p><p> Dim fType(0) As Integer, fData(0) As Variant<br/> fType(0) = 0: fData(0) = "DIMENSION"<br/> sSet.Select acSelectionSetAll, , , fType, fData</p> 好像应是三维点
页:
[1]