<?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 retrieve active layout during plot preview? in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-retrieve-active-layout-during-plot-preview/m-p/5777141#M10957</link>
    <description>&lt;P&gt;Thank you Balaji.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
    <pubDate>Wed, 19 Aug 2015 07:15:06 GMT</pubDate>
    <dc:creator>maisoui</dc:creator>
    <dc:date>2015-08-19T07:15:06Z</dc:date>
    <item>
      <title>How to retrieve active layout during plot preview?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-retrieve-active-layout-during-plot-preview/m-p/5766102#M10955</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a custom entity which&amp;nbsp;&lt;SPAN&gt;always displays a Plan view. To do that, I need to retrieve the current layout to get the view direction,&amp;nbsp;the camera up vector and the &lt;EM&gt;view X axis. &lt;/EM&gt;In case of plot generation, I need to adapt the &lt;EM&gt;view X axis&lt;/EM&gt;&amp;nbsp;according to the active layout plot rotation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if(m_pMode-&amp;gt;context()-&amp;gt;isPlotGeneration())
{
	//get the plot configuration of the current layout
	AcApLayoutManager * pLayoutManager = static_cast&amp;lt;AcApLayoutManager *&amp;gt;(acdbHostApplicationServices()-&amp;gt;layoutManager());
	AcDbLayout * pLayout = pLayoutManager-&amp;gt;findLayoutNamed(pLayoutManager-&amp;gt;findActiveLayout(false));
	assert(pLayout != NULL);
	if(pLayout != NULL)
	{
		//check if this plot is rotated or not
		switch(pLayout-&amp;gt;plotRotation())
		{
		case AcDbPlotSettings::PlotRotation::k90degrees:
			m_viewXAxis.rotateBy(-PI / 2., m_viewDirection);
			break;

		case AcDbPlotSettings::PlotRotation::k180degrees:
			m_viewXAxis.rotateBy(PI, m_viewDirection);
			break;

		case AcDbPlotSettings::PlotRotation::k270degrees:
			m_viewXAxis.rotateBy(PI / 2., m_viewDirection);
			break;
		}
	}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, everything works perfectly, but when I use the plot dialog, changes are not repercuted in the active layout&amp;nbsp;I have. It seems that the plot dialog have an internal copy of the active layout, and don't apply changes to the "real" active layout.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/182924i0C9EC5724C5DDF8C/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="2015-08-11 16_51_22-Plot - Layout1.png" title="2015-08-11 16_51_22-Plot - Layout1.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my question is : How can I&amp;nbsp;retrieve the information used by the plot dialog ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note : If I press on "Apply to Layout" button, close the dialog and re-open it, preview is now ok because I receive updated information from AcDbLayout.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 15:05:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-retrieve-active-layout-during-plot-preview/m-p/5766102#M10955</guid>
      <dc:creator>maisoui</dc:creator>
      <dc:date>2015-08-11T15:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve active layout during plot preview?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-retrieve-active-layout-during-plot-preview/m-p/5775376#M10956</link>
      <description>&lt;P&gt;Hi Jonathan,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a known behavior.&lt;/P&gt;
&lt;P&gt;The layout is not updated until the plot ends and so the information on plot rotation is not available during preview.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The workaround for this is to use the plot reactor.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The plot rotation can be obtained using&amp;nbsp;&lt;/SPAN&gt;AcPlPlotReactor::beginDocument from its&amp;nbsp;AcPlPlotInfo::overrideSettings.&lt;/P&gt;
&lt;P&gt;To identify the&amp;nbsp;preview mode, please use the&amp;nbsp;PlotType parameter of the&amp;nbsp;AcPlPlotReactor::beginPlot method.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2015 08:58:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-retrieve-active-layout-during-plot-preview/m-p/5775376#M10956</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2015-08-18T08:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve active layout during plot preview?</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/how-to-retrieve-active-layout-during-plot-preview/m-p/5777141#M10957</link>
      <description>&lt;P&gt;Thank you Balaji.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2015 07:15:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/how-to-retrieve-active-layout-during-plot-preview/m-p/5777141#M10957</guid>
      <dc:creator>maisoui</dc:creator>
      <dc:date>2015-08-19T07:15:06Z</dc:date>
    </item>
  </channel>
</rss>

