<?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: Existing selected viewport in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/existing-selected-viewport/m-p/9688467#M18947</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;after this line of code &lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: inherit; font-family: Menlo,Monaco,Consolas,'Courier New',monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;&amp;nbsp;ed.SwitchToModelSpace()&lt;/SPAN&gt;'&amp;nbsp; you will enter in the model space&lt;BR /&gt;you trying to select some objects using selection filter..,&lt;BR /&gt;if you want to return to paper space just pass the command '&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: inherit; font-family: Menlo,Monaco,Consolas,'Courier New',monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;&amp;nbsp; ed.SwitchToPaperSpace()&lt;/SPAN&gt;'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can also pass command 'CHSPACE' by command method to return to paper space..&lt;/P&gt;</description>
    <pubDate>Thu, 13 Aug 2020 01:42:38 GMT</pubDate>
    <dc:creator>mujibur.rahman</dc:creator>
    <dc:date>2020-08-13T01:42:38Z</dc:date>
    <item>
      <title>Existing selected viewport</title>
      <link>https://forums.autodesk.com/t5/net-forum/existing-selected-viewport/m-p/9650750#M18946</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a part of my current command i need to select a viewport to get te points of it, tramsform them to the model space an select all entities within the viewport area. The problem is that when i selected this viewport, the program get me inside of it and i don't know how to exist it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;after that, commnads like Editor.SwitchtoModelSpace() does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried disposing the viewport or with using but neither they works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could somebody help me with this problem?&lt;/P&gt;&lt;P&gt;Probably it is trivial but I can't found the key of the problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; Dim opt As PromptEntityOptions = New PromptEntityOptions("Pick a Viewport")
                opt.SetRejectMessage("object must be a viewport")
                opt.AddAllowedClass(GetType(Viewport), True)
                Dim per As PromptEntityResult = ed.GetEntity(opt)

                If per.Status &amp;lt;&amp;gt; PromptStatus.OK Then
                    ed.WriteMessage("Error intentando obtener el objeto seleccionado. Saliendo de la función.")
                    Return
                End If

                Dim PSVPpoints As Point3dCollection = New Point3dCollection
                Dim MSVPpoints As Point3dCollection = New Point3dCollection
                Using VP As Viewport = tr.GetObject(per.ObjectId, OpenMode.ForRead)


                    ed.WriteMessage("El número de puntos antes de obtener los de la viewport son {0}" + vbCrLf, PSVPpoints.Count)
                    VP.GetGripPoints(PSVPpoints, New IntegerCollection(), New IntegerCollection())
                    ed.WriteMessage("El número de puntos en la coleccion es : {0}" + vbCrLf, PSVPpoints.Count)




                    Dim tpm As Point3d = PSVPpoints(2)
                    PSVPpoints(2) = PSVPpoints(1)
                    PSVPpoints(1) = tpm

                    PSVPpoints.Remove(PSVPpoints(PSVPpoints.Count - 1))



                    Dim PSDSC2UCS = PSDCS2DCS(VP) * DCS2WCS(VP) * ed.CurrentUserCoordinateSystem


                    For Each pnt As Point3d In PSVPpoints
                        Dim point As Point3d
                        point = pnt.TransformBy(PSDSC2UCS)

                        MSVPpoints.Add(point)
                        ed.WriteMessage("Punto en PS: {0}   Punto en MS: {1}" + vbCrLf, pnt, point)
                    Next
                End Using

                ed.WriteMessage("tenemos {0} puntos transladados al model space" + vbCrLf, MSVPpoints.Count)
                ed.SwitchToModelSpace()

                ed.WriteMessage("he cambiado al model space")
                Dim acTypValAr(1) As TypedValue
                acTypValAr.SetValue(New TypedValue(DxfCode.LayerName, "SE-Zz_2-E"), 0)
                acTypValAr.SetValue(New TypedValue(DxfCode.Start, "MTEXT"), 1)
                Dim acSelFtr As SelectionFilter = New SelectionFilter(acTypValAr)

                Dim SelectionResult As PromptSelectionResult = ed.SelectCrossingPolygon(MSVPpoints, acSelFtr)
                If SelectionResult.Status &amp;lt;&amp;gt; PromptStatus.OK Then
                    Return
                End If
                Dim SelectSet As SelectionSet = SelectionResult.Value
                ed.WriteMessage("hemos seleccionado {0} entidades" + vbCrLf, SelectSet.Count)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, ignore all "ed.Writemessage()" as they are used for debbuging.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 07:09:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/existing-selected-viewport/m-p/9650750#M18946</guid>
      <dc:creator>carlosrdrzalns</dc:creator>
      <dc:date>2020-07-23T07:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Existing selected viewport</title>
      <link>https://forums.autodesk.com/t5/net-forum/existing-selected-viewport/m-p/9688467#M18947</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;after this line of code &lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: inherit; font-family: Menlo,Monaco,Consolas,'Courier New',monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;&amp;nbsp;ed.SwitchToModelSpace()&lt;/SPAN&gt;'&amp;nbsp; you will enter in the model space&lt;BR /&gt;you trying to select some objects using selection filter..,&lt;BR /&gt;if you want to return to paper space just pass the command '&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: inherit; font-family: Menlo,Monaco,Consolas,'Courier New',monospace; font-size: inherit; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;&amp;nbsp; ed.SwitchToPaperSpace()&lt;/SPAN&gt;'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can also pass command 'CHSPACE' by command method to return to paper space..&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 01:42:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/existing-selected-viewport/m-p/9688467#M18947</guid>
      <dc:creator>mujibur.rahman</dc:creator>
      <dc:date>2020-08-13T01:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Existing selected viewport</title>
      <link>https://forums.autodesk.com/t5/net-forum/existing-selected-viewport/m-p/9688693#M18948</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6623146"&gt;@mujibur.rahman&lt;/a&gt;&amp;nbsp;it works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i thought that ed.SwithcToModelSpace will change to the model Space tab instead of entering the viewport.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 06:42:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/existing-selected-viewport/m-p/9688693#M18948</guid>
      <dc:creator>carlosrdrzalns</dc:creator>
      <dc:date>2020-08-13T06:42:21Z</dc:date>
    </item>
  </channel>
</rss>

