<?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: setVisualStyle make no effect in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7393112#M7644</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;I try your suggestion, but it still not work.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you mean that the viewport doesn't show up with the new visual style?&lt;/P&gt;
&lt;P&gt;Maybe some graphics refresh is required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try&amp;nbsp; &lt;A title="ads_regen()" href="http://jprdintprev.autodesk.com/adn/servlet/devnote?siteID=4814862&amp;amp;id=11845587&amp;amp;preview=1&amp;amp;linkID=4900509" target="_blank"&gt;ads_regen()&lt;/A&gt; and/or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;AcTransactionManager *pAcTransactionManager=actrTransactionManager;
if (pAcTransactionManager)
{
   pAcTransactionManager-&amp;gt;queueForGraphicsFlush();
   pAcTransactionManager-&amp;gt;flushGraphics();
}
acedUpdateDisplay();&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Sep 2017 07:12:10 GMT</pubDate>
    <dc:creator>tbrammer</dc:creator>
    <dc:date>2017-09-20T07:12:10Z</dc:date>
    <item>
      <title>setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7386761#M7641</link>
      <description>&lt;P&gt;hi, community,&lt;/P&gt;&lt;P&gt;I want to set "Conceptual" visual style to one viewpot, but it makes no effect.&lt;/P&gt;&lt;P&gt;On Autocad, I find that the label on viewport change to "&lt;SPAN&gt;Conceptual&lt;/SPAN&gt;", but the entities make no change, still the default style "2D wireframe".&lt;/P&gt;&lt;P&gt;here is my code:&lt;/P&gt;&lt;PRE&gt;void AdjustViewport(const CString&amp;amp; strLayout, int nIndex, const std::vector&amp;lt;AcDbObjectId&amp;gt;&amp;amp; vecEnt, const AcGePoint3d&amp;amp; modelCenter)
{
	AcDbViewport* pViewport = GetViewport(strLayout, nIndex);

	if (pViewport == nullptr)
	{
		ASSERT(pViewport != nullptr);
		return;
	}

	int nRetActiveLayout = acedCommand(RTSTR, _T("layout"), RTSTR, _T(""), RTSTR, _T("testCopy"), 0);
	ASSERT(nRetActiveLayout == RTNORM);

	acedMspace();

	Acad::ErrorStatus es = acedSetCurrentVPort(pViewport);
	ASSERT(es == Acad::eOk);

	int nSetSWISO = acedCommand(RTSTR, _T("-view"), RTSTR, _T("_swiso"), 0);
	ASSERT(nSetSWISO == RTNORM);

	ads_name ssname;
	acedSSAdd( NULL, NULL, ssname );
	GroupSelect(vecEnt, ssname);
	acedSSSetFirst( ssname, NULL );
	int nZOOM = acedCommand(
		RTSTR, _T("_ZOOM"),
		RTSTR, _T("_OBJECT"),
		RTPICKS, ssname, 
		RTSTR, _T(""),
		RTNONE);
	ASSERT(nZOOM == RTNORM);
	acedSSFree(ssname);
	acedSSSetFirst( NULL, NULL );

	AcDbObjectId vsId = AcDbObjectId::kNull;
	AcDbDictionaryPointer pNOD(acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;visualStyleDictionaryId(), AcDb::kForRead);
	pNOD-&amp;gt;getAt(ACRX_T("Conceptual"), vsId);

	Acad::ErrorStatus esSetVS = pViewport-&amp;gt;setVisualStyle(vsId);
	ASSERT(esSetVS == Acad::eOk);

	//SetVisualStyle(vecEnt);

	pViewport-&amp;gt;updateDisplay();

	pNOD-&amp;gt;close();
	pViewport-&amp;gt;close();
}&lt;/PRE&gt;&lt;P&gt;pls help, thx!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 06:23:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7386761#M7641</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-18T06:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7391304#M7642</link>
      <description>&lt;P&gt;Please try to call&amp;nbsp;&amp;nbsp; &lt;FONT face="courier new,courier"&gt;pNOD-&amp;gt;close();&lt;/FONT&gt;&lt;BR /&gt;before&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; pViewport-&amp;gt;setVisualStyle(vsId);&lt;/FONT&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 16:06:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7391304#M7642</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2017-09-19T16:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7392715#M7643</link>
      <description>&lt;P&gt;hi,&amp;nbsp;tbrammer&lt;/P&gt;&lt;P&gt;I try your suggestion, but it still not work.&lt;/P&gt;&lt;P&gt;Anyway, I set visual style directly in my template dwg file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx,&lt;/P&gt;&lt;P&gt;nolan&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 02:07:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7392715#M7643</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-20T02:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7393112#M7644</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;I try your suggestion, but it still not work.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you mean that the viewport doesn't show up with the new visual style?&lt;/P&gt;
&lt;P&gt;Maybe some graphics refresh is required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try&amp;nbsp; &lt;A title="ads_regen()" href="http://jprdintprev.autodesk.com/adn/servlet/devnote?siteID=4814862&amp;amp;id=11845587&amp;amp;preview=1&amp;amp;linkID=4900509" target="_blank"&gt;ads_regen()&lt;/A&gt; and/or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;AcTransactionManager *pAcTransactionManager=actrTransactionManager;
if (pAcTransactionManager)
{
   pAcTransactionManager-&amp;gt;queueForGraphicsFlush();
   pAcTransactionManager-&amp;gt;flushGraphics();
}
acedUpdateDisplay();&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Sep 2017 07:12:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7393112#M7644</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2017-09-20T07:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7393460#M7645</link>
      <description>&lt;P&gt;I don't know whether is vs2010 can't find&amp;nbsp;&amp;nbsp;ads_regen(), so I can't try this.&lt;/P&gt;&lt;P&gt;And I try&amp;nbsp;actrTransactionManager, but it alse makes no effect, somewhat disappointed.&lt;/P&gt;&lt;P&gt;but, thanks all the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 09:40:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7393460#M7645</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-20T09:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7394204#M7646</link>
      <description>&lt;P&gt;You can use ads_regen in &lt;U&gt;all&lt;/U&gt; AutoCAD versions since 2000.&lt;/P&gt;
&lt;P&gt;With AutoCAD 2014 you &lt;U&gt;have to add next definition&lt;/U&gt; (as far as this function is not documented and is not defined in any of .h-files):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;void ads_regen(void);&lt;/PRE&gt;
&lt;P&gt;Also you have to link with accore.lib&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 13:38:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7394204#M7646</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-09-20T13:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7398708#M7647</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;: Could you suggest the ARX Dev team to add ads_regen() to the ARX headers and docs? Or are there any reasons to "hide" this quite important function?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 15:52:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7398708#M7647</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2017-09-21T15:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7398772#M7648</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/845950"&gt;@tbrammer&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;: Could you suggest the ARX Dev team to add ads_regen() to the ARX headers and docs? Or are there any reasons to "hide" this quite important function?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Dear &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/656250"&gt;@artc2&lt;/a&gt; !&lt;/P&gt;
&lt;P&gt;I hope you can explain why ads_regen is not documented and not added in any of .h-file within ObjectARX SDK since AutoCAD 2000.&lt;/P&gt;
&lt;P&gt;Please!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 16:04:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7398772#M7648</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-09-21T16:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7406182#M7649</link>
      <description>&lt;P&gt;The same topic is dicussed &lt;A title="AcDbViewport::setVisualStyle() do not work" href="https://forums.autodesk.com/t5/objectarx/acdbviewport-setvisualstyle-do-not-work/td-p/7379834" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Here 's the solution I just found and postet there:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you switch from "2D wireframe" to a 3D visual style, an AcGsView needs to be created. This code works for AutoCAD 2018:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;//Need AcDrawBridge.lib for AcGsKernelDescriptor::k3DDrawing&lt;BR /&gt;#pragma comment(lib, "AcDrawBridge.lib")&lt;BR /&gt;&lt;BR /&gt;void SetVisualStyle(AcDbObjectId idVP)
{
	Acad::ErrorStatus es;
	AcDbObjectId vsId = AcDbObjectId::kNull;
	AcDbDictionaryPointer pNOD(acdbHostApplicationServices()-&amp;gt;workingDatabase()-&amp;gt;visualStyleDictionaryId(), AcDb::kForRead);
	pNOD-&amp;gt;getAt(ACRX_T("Conceptual"), vsId);

 
	int vpNum = -1;
	AcDbViewport *pViewport;	
	if ((es = acdbOpenObject(pViewport, idVP, AcDb::kForWrite)) == Acad::eOk)
	{
		vpNum = pViewport-&amp;gt;number();
		pViewport-&amp;gt;setVisualStyle(vsId);
		pViewport-&amp;gt;close();
	}

	AcGsView *pView = acgsGetCurrent3dAcGsView(vpNum);
	if (!pView)
	{
		AcGsKernelDescriptor gsKernel;
		gsKernel.addSupport(AcGsKernelDescriptor::k3DDrawing);
		pView = acgsObtainAcGsView(vpNum, gsKernel);    // create if necessary.
	}
	if (pView)
		pView-&amp;gt;show();

	void ads_regen();
	ads_regen();
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Sep 2017 12:27:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7406182#M7649</guid>
      <dc:creator>tbrammer</dc:creator>
      <dc:date>2017-09-25T12:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7406912#M7650</link>
      <description>It's not documented nor in any public header file because it was never intended for anything other than very specific purposes in AutoCAD internal code and has not been tested for general use.</description>
      <pubDate>Mon, 25 Sep 2017 16:02:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7406912#M7650</guid>
      <dc:creator>artc2</dc:creator>
      <dc:date>2017-09-25T16:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7407001#M7651</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/656250"&gt;@artc2&lt;/a&gt; wrote:&lt;BR /&gt;It's not documented nor in any public header file because it was never intended for anything other than very specific purposes in AutoCAD internal code and has not been tested for general use.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thank for explanation! So this function internal is very different with _REGEN command? I've used this function many years instead of _REGEN in order to prevent using command methods.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 16:31:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7407001#M7651</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2017-09-25T16:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: setVisualStyle make no effect</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7411709#M7652</link>
      <description>No, ads_regen() and the REGEN command are fairly similar, but they are not exactly the same.  The primary difference is that the code path for the REGEN command will only work in a command context whereas ads_regen() does not have that requirement.</description>
      <pubDate>Wed, 27 Sep 2017 01:59:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/setvisualstyle-make-no-effect/m-p/7411709#M7652</guid>
      <dc:creator>artc2</dc:creator>
      <dc:date>2017-09-27T01:59:59Z</dc:date>
    </item>
  </channel>
</rss>

