Reply to Message

View discussion in a popup

Replying to:
nam_h_tran
in reply to: 18348401357

Hi. Sorry to open this topic again. But you know how to handle it in object arx? (c++). Or how to call the internal library of autocad in object arx?. Here the full verion of code in c++: Im using ads_regen() but it same problem in C#

RestoreLayer() 
{
	AcString          M1 = multilingual_.GetValue(L"M1");
	AcDbDatabase* db = acdbHostApplicationServices()->workingDatabase();
	AcDbLayerStateManager* layerStateManager = db->getLayerStateManager();
	
	try
	{
		if (layerStateManager->hasLayerState(LAYER_NAME) == true)
		{
			AcDbDictionary* dic_layerstate;
			Acad::ErrorStatus  es = acdbOpenObject(dic_layerstate, layerStateManager->layerStatesDictionaryId(true), kForRead);
			if (es == Acad::eOk && dic_layerstate != nullptr)
			{
				GetLayoutAndViewPort(dic_layerstate);
			}
			RestoreData(layerStateManager, db);
			layerStateManager->deleteLayerState(LAYER_NAME);
			ads_regen();
		}
		else
		{
			throw acutPrintf(multilingual_.GetValue(L"M2"));
		}
	}
	catch (...)
	{
		throw;
	}
}