5 Posts
0 Kudos
Registered: ‎05-31-2012
Post 1 of 2
Accepted Solution

Need help with PromptSelectionResult Problem

387 Views, 1 Replies
02-07-2013 09:34 AM

I am trying to select points within 3 feet of a polyline segment, sort the points, add them to a point collection, and then move on to the next segment. The problem I am having is in the selection set works for the first segment and then after I loop through for the next segment it is not picking up on the points in the selection window. 



                For j As Integer = 0 To nVertex - 2
                    PtBeg = poly.GetPoint2dAt(j)
                    PtEnd = poly.GetPoint2dAt(j + 1)
                    ovdist = PtBeg.GetDistanceTo(PtEnd)
                    cdist = Math.Sqrt(9 + (ovdist * ovdist))
                    FindCircleCircleIntersections(PtBeg.X, PtBeg.Y, 3, PtEnd.X, PtEnd.Y, cdist, wpt3, wpt4)
                    FindCircleCircleIntersections(PtEnd.X, PtEnd.Y, 3, PtBeg.X, PtBeg.Y, cdist, wpt5, wpt6)
                    wpt7 = New Point3d(wpt3.X, wpt3.Y, 0)
                    wpt8 = New Point3d(wpt4.X, wpt4.Y, 0)
                    wpt9 = New Point3d(wpt5.X, wpt5.Y, 0)
                    wpt10 = New Point3d(wpt6.X, wpt6.Y, 0)


                    ptres = acDoc.Editor.SelectWindowPolygon(wpt, ptfilter)
                    If ptres.Status = PromptStatus.OK Then
                        Dim ptSS As Autodesk.AutoCAD.EditorInput.SelectionSet = ptres.Value
                        Dim points As ObjectId() = ptSS.GetObjectIds()

                        For Each ptid In points

                        Do Until idcol.Count = 0

                            counter = 0
                            For Each ptid In idcol
                                oPoint = DirectCast((acTrans.GetObject(ptid, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead)).AcadObject, AeccPoint)

                                If counter = 0 Then
                                    smID = ptid
                                    Pt1 = New Point2d(oPoint.Easting, oPoint.Northing)
                                    odist = Pt1.GetDistanceTo(PtBeg)
                                    Pt3d = New Point3d(Pt1.X, Pt1.Y, 0)
                                    If odist = 0 Or odist = ovdist Then
                                    End If
                                    Pt2 = New Point2d(oPoint.Easting, oPoint.Northing)
                                    dist = Pt2.GetDistanceTo(PtBeg)
                                    If dist < odist And Not dist = 0 And Not dist = ovdist Then
                                        smID = ptid
                                        Pt1 = Pt2
                                        Pt3d = New Point3d(Pt1.X, Pt1.Y, 0)
                                        odist = dist
                                    End If
                                    If dist = 0 Or dist = ovdist Then
                                    End If
                                End If
                                counter += 1



                    End If


I do not see that you cleaned wpt variable in the loop.

1,467 Posts
277 Kudos
Registered: ‎04-09-2008
Post 2 of 2

Re: Need help with PromptSelectionResult Problem

02-07-2013 10:23 AM in reply to: tdunn_3

I do not see that you cleaned wpt variable in the loop.

Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!