- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a custom entity which always displays a Plan view. To do that, I need to retrieve the current layout to get the view direction, the camera up vector and the view X axis. In case of plot generation, I need to adapt the view X axis according to the active layout plot rotation.
if(m_pMode->context()->isPlotGeneration())
{
//get the plot configuration of the current layout
AcApLayoutManager * pLayoutManager = static_cast<AcApLayoutManager *>(acdbHostApplicationServices()->layoutManager());
AcDbLayout * pLayout = pLayoutManager->findLayoutNamed(pLayoutManager->findActiveLayout(false));
assert(pLayout != NULL);
if(pLayout != NULL)
{
//check if this plot is rotated or not
switch(pLayout->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;
}
}
}
So far, everything works perfectly, but when I use the plot dialog, changes are not repercuted in the active layout 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.
So my question is : How can I retrieve the information used by the plot dialog ?
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.
Best regards,
Jonathan
Solved! Go to Solution.