|
Obtain the Visual Style/Shademode of a Viewport using ObjectARX[code]// paper space checks
AcDbObjectPointer<AcDbViewport> viewportType(vpObjId, AcDb::kForRead);
if (viewportType.openStatus() == Acad::eOk)
{
TCHAR *visualStyleName = NULL;
AcDbDictUtil::getVisualStyleName(visualStyleName, viewportType->visualStyle());
acutPrintf(_T("\nVisual Style = %s"), visualStyleName);
// free up the string
acutDelString(visualStyleName);
}
else
{
// model space
AcDbObjectPointer<AcDbViewportTableRecord> viewport(vpObjId, AcDb::kForRead);
if (viewport.openStatus() == Acad::eOk)
{
TCHAR *visualStyleName = NULL;
AcDbDictUtil::getVisualStyleName(visualStyleName, viewport->visualStyle());
acutPrintf(_T("\nVisual Style = %s"), visualStyleName);
// free up the string
acutDelString(visualStyleName);
}
else
acutPrintf(_T("\nVisual Style = 2dWireframe"));
}[/code] |
|