本帖最后由 guohq 于 2011-6-15 11:49 编辑
- Public Enum PolygonSelectType
- ''' <summary>
- ''' 圈交(实选)
- ''' </summary>
- ''' <remarks></remarks>
- CrossingPolygon = 1
- ''' <summary>
- ''' 圈围(范选)
- ''' </summary>
- ''' <remarks></remarks>
- WindowPolygon = 2
- End Enum
-
- Public Function SelectEntsByPolygon(ByVal objEditor As Editor, ByVal Pts As Point3dCollection, Optional ByVal sFilter As SelectionFilter = Nothing, Optional ByVal SelectType As PolygonSelectType = PolygonSelectType.CrossingPolygon) As ObjectId()
- Dim resSel As PromptSelectionResult = Nothing
- Select Case SelectType
- Case 1
- If sFilter Is Nothing Then
- resSel = objEditor.SelectCrossingPolygon(Pts)
- Else
- resSel = objEditor.SelectCrossingPolygon(Pts, sFilter)
- End If
- Case 2
- If sFilter Is Nothing Then
- resSel = objEditor.SelectWindowPolygon(Pts)
- Else
- resSel = objEditor.SelectWindowPolygon(Pts, sFilter)
- End If
- Case Else
- '暂时没有其它情况
- End Select
- If resSel.Value Is Nothing Then
- Return New clsAADS.ObjectId() {}
- Else
- Return (resSel.Value.GetObjectIds())
- End If
- End Function
多边形的顶点坐标转到point3dcollection就不用说了吧 |