<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: WP Selectionset from existing poly in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/wp-selectionset-from-existing-poly/m-p/3140222#M59520</link>
    <description>&lt;P&gt;For&amp;nbsp;i as Integer = 0 to acPlin.NumberOfVertices - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnts.Add (acPlin.GetPoint3dAt(i)&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on your situation, you will have&amp;nbsp;a problem achieving the&amp;nbsp;desired result if the polyline&amp;nbsp;contains arc segments.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Aug 2011 23:30:38 GMT</pubDate>
    <dc:creator>chiefbraincloud</dc:creator>
    <dc:date>2011-08-29T23:30:38Z</dc:date>
    <item>
      <title>WP Selectionset from existing poly</title>
      <link>https://forums.autodesk.com/t5/net-forum/wp-selectionset-from-existing-poly/m-p/3140186#M59519</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sure someone will make this look easy, but I am having a hard time getting it to work. &amp;nbsp;Bascially I want to create a WP selection set from an existing polyline that the user picks. &amp;nbsp;The selectionset should select everything inside of the closed polyline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
        Dim acCurDb As Database = acDoc.Database
        Dim acEd As Editor = DocumentManager.MdiActiveDocument.Editor

        '' Start a transaction
        Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()

            '' Lock the document
            Dim acDocLock As DocumentLock = acDoc.LockDocument

            Try
                '' Pick Layout line (Polyline) 
                Dim acPlin As Polyline

                '' Define prompt options
                Dim acPrmptPl As New EditorInput.PromptSelectionOptions
                acPrmptPl.AllowDuplicates = False
                acPrmptPl.SinglePickInSpace = True
                acPrmptPl.SingleOnly = True
                acPrmptPl.AllowSubSelections = False
                acPrmptPl.RejectObjectsFromNonCurrentSpace = True
                acPrmptPl.MessageForAdding = (vbLf &amp;amp; "Select panel polyline:")

                Dim acTypdVal(0) As TypedValue
                acTypdVal(0) = New DatabaseServices.TypedValue(0, "LWPOLYLINE")
                Dim myFilterPl As New EditorInput.SelectionFilter(acTypdVal)
                Dim acPSRPl As PromptSelectionResult
RePick2:
                acPSRPl = acEd.GetSelection(acPrmptPl, myFilterPl)

                '' If selection is ok, then continue 
                If acPSRPl.Status = PromptStatus.OK Then
                    
                    For Each acObjId As ObjectId In acPSRPl.Value.GetObjectIds
                        acPlin = acObjId.GetObject(OpenMode.ForRead)
                    Next

                    Dim pnts As New Point3dCollection()
                    For Each ver As Vertex2d In acPlin
                        pnts.Add(ver.Position)
                    Next

                    Dim Polygon As New Point3dCollection(pnts)
                    Dim PolyPrompt_res As PromptSelectionResult = acEd.SelectWindowPolygon(Polygon)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot seem to get a 3d collection of points from a polyline. &amp;nbsp;I have tried a few different things like converting the polyline to a polyline3D, but no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My assumptions are that I need to get the colection of vertices from the polyline. &amp;nbsp;Then, I need a new collection of points to create the Window Polygon. &amp;nbsp;I pass those points to the SelectWindowPolygon method to get my selection window. &amp;nbsp;From there I do stuff! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I may be going about this the wrong way. &amp;nbsp;And ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2011 22:43:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wp-selectionset-from-existing-poly/m-p/3140186#M59519</guid>
      <dc:creator>Rob.O</dc:creator>
      <dc:date>2011-08-29T22:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: WP Selectionset from existing poly</title>
      <link>https://forums.autodesk.com/t5/net-forum/wp-selectionset-from-existing-poly/m-p/3140222#M59520</link>
      <description>&lt;P&gt;For&amp;nbsp;i as Integer = 0 to acPlin.NumberOfVertices - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnts.Add (acPlin.GetPoint3dAt(i)&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on your situation, you will have&amp;nbsp;a problem achieving the&amp;nbsp;desired result if the polyline&amp;nbsp;contains arc segments.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2011 23:30:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wp-selectionset-from-existing-poly/m-p/3140222#M59520</guid>
      <dc:creator>chiefbraincloud</dc:creator>
      <dc:date>2011-08-29T23:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: WP Selectionset from existing poly</title>
      <link>https://forums.autodesk.com/t5/net-forum/wp-selectionset-from-existing-poly/m-p/3140788#M59521</link>
      <description>&lt;P&gt;Bisides the reply you already got, one more thing to pay attention when using SelectWindowPolygon() (or other similar methods): the selecting polygon MUST be entirely within the current view/screen, or the SelectionSet returned may not be correct. This is known issue. So, you may want to zoom the view before calling SelectWindowPolygon() so that the selecting polygon is within current view.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2011 13:26:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wp-selectionset-from-existing-poly/m-p/3140788#M59521</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2011-08-30T13:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: WP Selectionset from existing poly</title>
      <link>https://forums.autodesk.com/t5/net-forum/wp-selectionset-from-existing-poly/m-p/3140882#M59522</link>
      <description>&lt;P&gt;Thanks ChiefB! &amp;nbsp;Works great (as expected)!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lucily this code will never be dealing with curved polyline segments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Norman,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the tip. &amp;nbsp;I just tested it and you are absolutely correct! &amp;nbsp;The objects off teh screen were not included in the selectionset!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2011 14:12:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/wp-selectionset-from-existing-poly/m-p/3140882#M59522</guid>
      <dc:creator>Rob.O</dc:creator>
      <dc:date>2011-08-30T14:12:53Z</dc:date>
    </item>
  </channel>
</rss>

