<?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: Update Viewport with database is not working. in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12744848#M7932</link>
    <description>&lt;P&gt;I just rediscovered this after 2 hours of troubleshooting.&lt;/P&gt;&lt;P&gt;In my experience, only set HostApplicationServices.WorkingDatabase to side database while touching system vars using AcAp.SetSystemVariable() method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not dealing with viewports though, just modelspace.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2024 22:46:04 GMT</pubDate>
    <dc:creator>JamesMaeding</dc:creator>
    <dc:date>2024-04-30T22:46:04Z</dc:date>
    <item>
      <title>Update Viewport with database is not working.</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12129538#M7928</link>
      <description>&lt;P&gt;I have no idea why after I work with vb.net with database, zoom of current view is changing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I want zoom extent the document without open document in editor, only database.readdwgfile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found some code on .net forum but I guess it doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim originalDB As Database = HostApplicationServices.WorkingDatabase

        Using AcadDB As New Database(False, True)
            AcadDB.ReadDwgFile(OldDwgFilePath, FileOpenMode.OpenForReadAndAllShare, False, Nothing)

            HostApplicationServices.WorkingDatabase = AcadDB

            If AcadDB.TileMode = True Then 'Model
                Using Trans As Transaction = AcadDB.TransactionManager.StartTransaction
                    Dim vpt As ViewportTable = Trans.GetObject(AcadDB.ViewportTableId, OpenMode.ForRead)
                    Dim vptr As ViewportTableRecord = Trans.GetObject(AcadDB.CurrentViewportTableRecordId, OpenMode.ForWrite)
                    vptr.CenterPoint = New Point2d(1000, 1000)
                    vptr.Height = 2000
                    vptr.Width = 2000

                    AcadDB.UpdateExt(True)
                End Using
            End If

            ZoomExtents_DB_2(AcadDB)

            AcadDB.SaveAs(NewDwgFilePath, DwgVersion.Current)
            HostApplicationServices.WorkingDatabase = originalDB

        End Using&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what actual code I used, include calculate for zoom extent but I changed it for fixed number for testing view is changed so I changed it as real numbers and it doesn't work(also not working with calculated numbers obviously)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I change current views zoom without open in editor?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 02:14:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12129538#M7928</guid>
      <dc:creator>cstotal_Autodesk</dc:creator>
      <dc:date>2023-07-27T02:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Update Viewport with database is not working.</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12137370#M7929</link>
      <description>&lt;P&gt;I just found if I saveas database when&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HostApplicationServices.WorkingDatabase = dwgfile Database&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It changes Zoom as Auto. so before saveas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;changed HostApplicationServices.WorkingDatabase to origin database&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 01:36:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12137370#M7929</guid>
      <dc:creator>cstotal_Autodesk</dc:creator>
      <dc:date>2023-07-31T01:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update Viewport with database is not working.</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12137496#M7930</link>
      <description>&lt;P&gt;Did you try committing the transaction ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 03:38:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12137496#M7930</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2023-07-31T03:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Update Viewport with database is not working.</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12137512#M7931</link>
      <description>&lt;P&gt;oh Yes. as I wrote on reply myself, it was solved. thank for replying.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 03:59:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12137512#M7931</guid>
      <dc:creator>cstotal_Autodesk</dc:creator>
      <dc:date>2023-07-31T03:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Update Viewport with database is not working.</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12744848#M7932</link>
      <description>&lt;P&gt;I just rediscovered this after 2 hours of troubleshooting.&lt;/P&gt;&lt;P&gt;In my experience, only set HostApplicationServices.WorkingDatabase to side database while touching system vars using AcAp.SetSystemVariable() method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not dealing with viewports though, just modelspace.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 22:46:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-viewport-with-database-is-not-working/m-p/12744848#M7932</guid>
      <dc:creator>JamesMaeding</dc:creator>
      <dc:date>2024-04-30T22:46:04Z</dc:date>
    </item>
  </channel>
</rss>

