fatal error on selectwindowpolygon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try to select an polyline (with always 4 corners).
Then I need to select everything within the polyline.
So far so good.
But when i try to access the selectionset i get an fatal error.
I don't no how to solve it.
I hope that someone can help me.
Greetings Jacco
Public Sub CrossingPolygonSelect()
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
Dim acDocEd As Editor = acDoc.Editor
Dim prObjectOptions As PromptEntityOptions = New PromptEntityOptions("Selecteer het aan te sluiten profiel : ")
Dim pt As Object
prObjectOptions.SetRejectMessage(vbLf + "Je moet een profiel selecteren" + vbLf)
prObjectOptions.AllowNone = False
pt = acDocEd.GetEntity(prObjectOptions)
If pt.Status <> PromptStatus.OK Then Exit Sub
Dim prof1 As ObjectId = pt.objectid
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
Dim ent0 As Polyline2d = acTrans.GetObject(prof1, OpenMode.ForRead)
Dim acPts3d As Point3dCollection = New Point3dCollection()
Dim pt0 As Point3d
pt0 = ent0.GetPointAtParameter(0)
acPts3d.Add(pt0)
pt0 = ent0.GetPointAtParameter(1)
acPts3d.Add(pt0)
pt0 = ent0.GetPointAtParameter(2)
acPts3d.Add(pt0)
pt0 = ent0.GetPointAtParameter(3)
acPts3d.Add(pt0)
Dim sres As PromptSelectionResult = acDocEd.SelectWindowPolygon(acPts3d) ', filter)
Dim acSSet As SelectionSet
acSSet = sres.Value
For Each acSSObj As SelectedObject In acSSet
MsgBox(acSSObj.ObjectId)
Next
acTrans.Commit()
End Using
End Sub