<?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 vb.net  - change to viewport (mspace) and zoom window in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9396557#M20041</link>
    <description>&lt;P&gt;hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have special job to do. current i have a layout with ONE viewport. my job is to change to modelspace, take a zoom window (left-buttom and right-top i know) and then go back to paperspace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have no idea!!!&lt;/P&gt;&lt;P&gt;could you help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regard Jan&lt;/P&gt;</description>
    <pubDate>Tue, 24 Mar 2020 14:00:06 GMT</pubDate>
    <dc:creator>jan_tappenbeck</dc:creator>
    <dc:date>2020-03-24T14:00:06Z</dc:date>
    <item>
      <title>vb.net  - change to viewport (mspace) and zoom window</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9396557#M20041</link>
      <description>&lt;P&gt;hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have special job to do. current i have a layout with ONE viewport. my job is to change to modelspace, take a zoom window (left-buttom and right-top i know) and then go back to paperspace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have no idea!!!&lt;/P&gt;&lt;P&gt;could you help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regard Jan&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 14:00:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9396557#M20041</guid>
      <dc:creator>jan_tappenbeck</dc:creator>
      <dc:date>2020-03-24T14:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net  - change to viewport (mspace) and zoom window</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9396918#M20042</link>
      <description>&lt;P&gt;There are several things that you need to be concerned with, such as being on the Model tab or a named layout along with which viewport is active when on a named layout.&amp;nbsp; Those things assigned, the following help topics should get you moving in the right direction:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Zoom subroutine is documented here&lt;BR /&gt;&lt;A href="https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-FAC1A5EB-2D9E-497B-8FD9-E11D2FF87B93" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-FAC1A5EB-2D9E-497B-8FD9-E11D2FF87B93&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Zoom to a specific area with the Zoom subroutine&lt;BR /&gt;&lt;A href="https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-AA770AAA-A008-47A9-9C2B-3ECD040A18ED" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-AA770AAA-A008-47A9-9C2B-3ECD040A18ED&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Demonstrates the use of the SwitchToPaperSpace and SwitchToModelSpace functions&lt;BR /&gt;&lt;A href="https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-61C22902-F63B-4204-86EC-FA37312D1B6E" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-61C22902-F63B-4204-86EC-FA37312D1B6E&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 15:33:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9396918#M20042</guid>
      <dc:creator>ambrosl</dc:creator>
      <dc:date>2020-03-24T15:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net  - change to viewport (mspace) and zoom window</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397126#M20043</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, i knew that - but to understand it better overall, I described the whole task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll look at it and then report it again if necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards Jan&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 16:34:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397126#M20043</guid>
      <dc:creator>jan_tappenbeck</dc:creator>
      <dc:date>2020-03-24T16:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net  - change to viewport (mspace) and zoom window</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397255#M20044</link>
      <description>&lt;P&gt;&lt;U&gt;Hi!&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;i look to the examples. zoom-function will not be the problem.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;the viewport-examples show how to create - but my template did have a viewport and so i search the way to collect the one viewport in current layout and switch to modell.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;reagards Jan&lt;/U&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 17:18:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397255#M20044</guid>
      <dc:creator>jan_tappenbeck</dc:creator>
      <dc:date>2020-03-24T17:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net  - change to viewport (mspace) and zoom window</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397393#M20045</link>
      <description>&lt;P&gt;hi !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i testet the function FourFloatingViewports in a empty layout - the Viewport element will create, but there is an error by switch to modelspace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-03-24_19h00_04.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/745143iA982E0DE82830651/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-03-24_19h00_04.png" alt="2020-03-24_19h00_04.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 18:05:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397393#M20045</guid>
      <dc:creator>jan_tappenbeck</dc:creator>
      <dc:date>2020-03-24T18:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net  - change to viewport (mspace) and zoom window</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397436#M20046</link>
      <description>&lt;P&gt;If your layout only has one viewport, you should be able to simply just toggle Model and Paper space using the&amp;nbsp;SwitchToPaperSpace and SwitchToModelSpace functions.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-F0906774-90AD-4AD2-9894-E37ACEF8035A" target="_blank"&gt;https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-F0906774-90AD-4AD2-9894-E37ACEF8035A&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get the viewports on the current layout, you can get the Block Table Record associated with the layout and then iterate its objects looking for the viewports.&amp;nbsp; Once you find the viewport, then you can set it current, switch to model space, zoom, and then switch back to paper space.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;   ' Step through current layout
    &amp;lt;CommandMethod("StepLayout")&amp;gt;
    Public Shared Sub StepLayout()
        ' Get the current document and database, and start a transaction
        Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
        Dim acCurDb As Database = acDoc.Database

        Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
            ' Reference the Layout Manager
            Dim acLayoutMgr As LayoutManager = LayoutManager.Current

            ' Get the current layout and output its name in the Command Line window
            Dim acLayout As Layout =
            acTrans.GetObject(acLayoutMgr.GetLayoutId(acLayoutMgr.CurrentLayout),
                              OpenMode.ForRead)

            ' Open the Block table for read
            Dim acBlkTbl As BlockTable
            acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)

            ' Open the Block table record for the current layout
            Dim acBlkTblRec As BlockTableRecord
            acBlkTblRec = acTrans.GetObject(acLayout.BlockTableRecordId,
                                        OpenMode.ForRead)

            ' Step through the Block table record
            For Each acObjId As ObjectId In acBlkTblRec
                acDoc.Editor.WriteMessage(vbLf &amp;amp; "DXF name: " &amp;amp; acObjId.ObjectClass().DxfName)
                acDoc.Editor.WriteMessage(vbLf &amp;amp; "ObjectID: " &amp;amp; acObjId.ToString())
                acDoc.Editor.WriteMessage(vbLf &amp;amp; "Handle: " &amp;amp; acObjId.Handle.ToString())
                acDoc.Editor.WriteMessage(vbLf)
            Next

            ' Dispose of the transaction
        End Using
    End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 18:17:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397436#M20046</guid>
      <dc:creator>ambrosl</dc:creator>
      <dc:date>2020-03-24T18:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net  - change to viewport (mspace) and zoom window</title>
      <link>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397502#M20047</link>
      <description>&lt;P&gt;I'm not able to reproduct your error.&amp;nbsp;Based on the Managed .NET libraries you are referencing, you might need to revise the following statements:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Current:&lt;/STRONG&gt; &lt;FONT face="courier new,courier"&gt;Dim acVportLast As Viewport = Nothing&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;To:&lt;/STRONG&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Dim acVportLast As DatabaseServices.Viewport = Nothing&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Current:&lt;/STRONG&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Using acVport As Viewport = New Viewport()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;To:&lt;/STRONG&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Using acVport As DatabaseServices.Viewport = New DatabaseServices.Viewport()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that doesn't work and you are able to post a version of the drawing in which the error comes up, please post the drawing and I can take a look at it.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 18:38:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/vb-net-change-to-viewport-mspace-and-zoom-window/m-p/9397502#M20047</guid>
      <dc:creator>ambrosl</dc:creator>
      <dc:date>2020-03-24T18:38:40Z</dc:date>
    </item>
  </channel>
</rss>

