|
[code]void SetViewportStyle(const CString& strLayout, int nIndex, string styleName)
{
AcDbViewport* pViewport = GetViewport(strLayout, nIndex); // ------- Where is this function??
if (pViewport == nullptr)
{
return;
}
AcDbObjectId vsId = AcDbObjectId::kNull;
AcDbDictionaryPointer pNOD(acdbHostApplicationServices()->workingDatabase()->visualStyleDictionaryId(), AcDb::kForRead);
pNOD->getAt(ACRX_T(styleName), vsId);
if (vsId == AcDbObjectId::knull)
{
return;
}
// ---- shouldn't you open the viewport for write here??
Acad::ErrorStatus esSetVS = pViewport->setVisualStyle(vsId);
if(esSetVS == Acad::eOk)
{
pViewport->updateDisplay();
pNOD->close();
pViewport->close();
}
}
[/code] |
|