<?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: How to force viewportDraw call in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5553277#M11308</link>
    <description>&lt;P&gt;Hi Owen,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Panning deosn't freeze autocad when I turn off &lt;STRONG&gt;Adaptive Degradation&lt;/STRONG&gt;.&amp;nbsp;But unlike Zooming it doesn't regenarate my drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my viewport Drawing, I have replaced&amp;nbsp; "&amp;nbsp;AcGsView *view "&amp;nbsp;by "&amp;nbsp;getNumPixelsInUnitSquare " to get aspect ratio. But that didn't help. Could you please explain what you mean by the viewport drawing code changes the view ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Mar 2015 15:26:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-23T15:26:50Z</dc:date>
    <item>
      <title>How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5549710#M11301</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I want to force the AutoCAD graphics system to call MyEntity::viewportDraw(). How can I achieve this ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 05:24:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5549710#M11301</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-20T05:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5549904#M11302</link>
      <description>&lt;P&gt;"Return Adesk::kFalse" in subWorldDraw(...).&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 10:30:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5549904#M11302</guid>
      <dc:creator>maisoui</dc:creator>
      <dc:date>2015-03-20T10:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5549925#M11303</link>
      <description>&lt;P&gt;Of course I have to return&amp;nbsp;&lt;SPAN&gt;Adesk::kFalse" in subWorldDraw. But,&amp;nbsp;&lt;/SPAN&gt;I want subViewportDraw(...) to be called every&amp;nbsp;time&amp;nbsp;I zoom or pan. this function gets called during regen, not necessarly on 'zoom' or 'pan'&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 10:51:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5549925#M11303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-20T10:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5550011#M11304</link>
      <description>&lt;P&gt;if i understand a problem correctly, AcEditorReactor::commandEnded can't help in all cases, cause you want to see changes inside pan/zoom.&amp;nbsp;So, as a variant, Hook on mouse events is what you need. inside hook use &lt;STRONG&gt;pEnt-&amp;gt;draw()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;you need in something like the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int startCommand = 0;

BOOL redrawHook(MSG* pMsg)
{
  if (pMsg-&amp;gt;message == WM_MOUSEWHEEL)
  {
    if (startCommand &amp;lt; 2)
    {
       startCommand++;
       PostMessage(adsw_hwndAcad,pMsg-&amp;gt;message,pMsg-&amp;gt;wParam,pMsg-&amp;gt;lParam);
       return FALSE;
    }
    else
    {// will work for 1/3 of mousewheel
      CYourClassApp::your_transparent_command();
      startCommand = 0;
      return TRUE;
    }
  }

  if (pMsg-&amp;gt;message == WM_MBUTTONUP)
  {
    CYourClassApp::your_transparent_command();
    return FALSE;
  }&lt;BR /&gt;&lt;BR /&gt;  return FALSE;
}

class CYourClassApp : public AcRxArxApp {
  virtual AcRx::AppRetCode On_kInitAppMsg(void* pkt)
  {
    ...
    acedRegisterFilterWinMsg(redrawHook);
    ...
  }
  
  virtual AcRx::AppRetCode On_kUnloadAppMsg(void* pkt)
  {
    ...
    acedRemoveFilterWinMsg(redrawHook);
    ...
  }
  
  static void your_transparent_command()
  {
    // force "draw" for needed entities using pEnt-&amp;gt;draw();
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 11:58:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5550011#M11304</guid>
      <dc:creator>nick83</dc:creator>
      <dc:date>2015-03-20T11:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5550224#M11305</link>
      <description>&lt;P&gt;You need to override subSetAttributes() in your custom entity&amp;nbsp;and include the kDrawableViewDependentViewportDraw flag in the returned value.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2015 13:54:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5550224#M11305</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2015-03-20T13:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5552250#M11306</link>
      <description>&lt;P&gt;Thanks Owen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;kDrawableViewDependentViewportDraw works correctly during ZOOM , but AutoCAD(2015) stops working(freezes) during PAN. Any idea what the problem is ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2015 20:04:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5552250#M11306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-22T20:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5552504#M11307</link>
      <description>&lt;P&gt;Without seeing your code I can only guess. My guess is that your viewport drawing code changes the view.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 04:22:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5552504#M11307</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2015-03-23T04:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5553277#M11308</link>
      <description>&lt;P&gt;Hi Owen,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Panning deosn't freeze autocad when I turn off &lt;STRONG&gt;Adaptive Degradation&lt;/STRONG&gt;.&amp;nbsp;But unlike Zooming it doesn't regenarate my drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my viewport Drawing, I have replaced&amp;nbsp; "&amp;nbsp;AcGsView *view "&amp;nbsp;by "&amp;nbsp;getNumPixelsInUnitSquare " to get aspect ratio. But that didn't help. Could you please explain what you mean by the viewport drawing code changes the view ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 15:26:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5553277#M11308</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-23T15:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5554284#M11309</link>
      <description>&lt;P&gt;&amp;nbsp;I have seen issues with the viewportDraw not getting called in a AcGiDrawableOverrule&amp;nbsp;even when&amp;nbsp;kDrawableViewDependentViewportDraw was specified when in "2d Wireframe" visual style. It had worked ok in other shaded modes. I am not sure if this is related to your query, so you&amp;nbsp;can also try changing the Visual style.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other way could be to use "kDrawableViewIndependentViewportDraw" as the attribute and&amp;nbsp;ensure that the viewportDraw gets called using&amp;nbsp;AcGsView::invalidateCachedViewportGeometry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Balaji&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2015 05:24:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5554284#M11309</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2015-03-24T05:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to force viewportDraw call</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5563067#M11310</link>
      <description>&lt;P&gt;I put '&lt;SPAN&gt;AcGsView::invalidateCachedViewportGeometry' &amp;nbsp; inside &amp;nbsp; &amp;nbsp;'&lt;/SPAN&gt;AcEditorReactor::viewChanged' and PANNING is working fine. It's a bit slower compared to Zooming though.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2015 11:16:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-force-viewportdraw-call/m-p/5563067#M11310</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-30T11:16:37Z</dc:date>
    </item>
  </channel>
</rss>

