<?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 Screen in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052183#M21149</link>
    <description>&lt;P&gt;If I remember well, there's an issue with the GetAcadDocument() extension method and VB.&lt;/P&gt;
&lt;P&gt;You should try like this:&lt;/P&gt;
&lt;PRE&gt;Dim doc As Document = Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;Dim docObj As Object = DocumentExtension.GetAcadDocument(doc)&lt;BR /&gt;docObj.Window.Focus()&lt;/PRE&gt;
&lt;P&gt;But it seems to me this can be done without using the COM object AcadDocument, you can access the Window directly from the .NET Document instance by simply doing:&lt;/P&gt;
&lt;PRE&gt;Dim doc As Document = Application.DocumentManager.MdiActiveDocument
doc.Window.Focus()&lt;/PRE&gt;</description>
    <pubDate>Fri, 27 Sep 2019 09:16:49 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2019-09-27T09:16:49Z</dc:date>
    <item>
      <title>Update Screen</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9051049#M21144</link>
      <description>&lt;P&gt;Some changes made in a palette do not get reflected on screen until the mouse moves to the drawing area.&lt;/P&gt;&lt;P&gt;When the mouse moves over the drawing area the updates are instantly reflected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Application.UpdateScreen() doesn't work.&lt;/P&gt;&lt;P&gt;SendStringToExecute"REGEN "&amp;nbsp;does, but with complicated drawings with xrefs it can take a long time to update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The commands I need to execute are very often so I don't want the user to be sitting back for 10 seconds every time they execute a command.&lt;/P&gt;&lt;P&gt;Is there a solution or workaround for this?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 19:32:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9051049#M21144</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2019-09-26T19:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update Screen</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9051824#M21145</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;does blog&amp;nbsp;&lt;A href="https://adndevblog.typepad.com/autocad/2013/03/use-of-windowfocus-in-autocad-2014.html" target="_blank"&gt;https://adndevblog.typepad.com/autocad/2013/03/use-of-windowfocus-in-autocad-2014.html&lt;/A&gt;&amp;nbsp;helps?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 06:17:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9051824#M21145</guid>
      <dc:creator>Virupaksha_aithal</dc:creator>
      <dc:date>2019-09-27T06:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update Screen</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9051990#M21146</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;That's the exact problem and solution but I need some help converting it to vb.net&lt;/P&gt;&lt;P&gt;Below is the converted code using an online converter.&lt;/P&gt;&lt;P&gt;And below that my attempt at adjusting it.&lt;/P&gt;&lt;P&gt;"Dynamic" is an unknown syntax.&lt;/P&gt;&lt;P&gt;Desperately hoping you or someone else can help me on this.&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="Capture.JPG" style="width: 605px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/681836iDEF6D8EAA829C898/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 07:48:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9051990#M21146</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2019-09-27T07:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Update Screen</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052094#M21147</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try replacing dynamic with Object.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 08:32:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052094#M21147</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-09-27T08:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update Screen</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052136#M21148</link>
      <description>&lt;P&gt;Sorry about this. Commenting out the converted portion left me with this&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="Capture.JPG" style="width: 625px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/681863i1979C0A245CCDEAA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 08:54:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052136#M21148</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2019-09-27T08:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Update Screen</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052183#M21149</link>
      <description>&lt;P&gt;If I remember well, there's an issue with the GetAcadDocument() extension method and VB.&lt;/P&gt;
&lt;P&gt;You should try like this:&lt;/P&gt;
&lt;PRE&gt;Dim doc As Document = Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;Dim docObj As Object = DocumentExtension.GetAcadDocument(doc)&lt;BR /&gt;docObj.Window.Focus()&lt;/PRE&gt;
&lt;P&gt;But it seems to me this can be done without using the COM object AcadDocument, you can access the Window directly from the .NET Document instance by simply doing:&lt;/P&gt;
&lt;PRE&gt;Dim doc As Document = Application.DocumentManager.MdiActiveDocument
doc.Window.Focus()&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Sep 2019 09:16:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052183#M21149</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-09-27T09:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update Screen</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052200#M21150</link>
      <description>&lt;PRE&gt;Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView()&lt;/PRE&gt;
&lt;P&gt;This static method can been helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 09:25:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052200#M21150</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2019-09-27T09:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Update Screen</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052257#M21151</link>
      <description>&lt;P&gt;Another way, recommended by &lt;A href="https://www.keanw.com/2011/02/managing-drag-drop-from-a-palette-into-autocad-using-net.html" target="_blank" rel="noopener"&gt;Kean Walmsley&lt;/A&gt;* that I extensively use with Palettes is to wrap the method related to AutoCAD in a CommandMethod and just call them from the palette with SendStringToExecute. This way you let AutoCAD do all the locking / focus stuff.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* "&lt;EM&gt;Once again there’s our important &lt;A href="https://en.wikipedia.org/wiki/Rule_of_thumb" target="_blank" rel="noopener"&gt;rule of thumb&lt;/A&gt; when it comes to implementing a modeless UI: rather than manually locking the current document, it’s safer to define a command – which will implicitly lock the current document – and call that from the UI via SendStringToExecute()."&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 09:50:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/9052257#M21151</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-09-27T09:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Update Screen</title>
      <link>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/10479919#M21152</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm going to drop this here which I found on another thread..&lt;/P&gt;&lt;P&gt;Seems to solve the problem when Utils.SetFocusToDwgView doesn't want to work and you don't want to&amp;nbsp;&lt;SPAN&gt;SendStringToExecute.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Private Declare Function SetFocus Lib "user32" (ByVal hwnd As System.IntPtr) As System.IntPtr&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;SetFocus(Application.DocumentManager.MdiActiveDocument.Window.Handle)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 16:01:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/update-screen/m-p/10479919#M21152</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2021-07-19T16:01:28Z</dc:date>
    </item>
  </channel>
</rss>

