C++ 2010
workPart = theSession->Parts()->Work();
displayPart = theSession->Parts()->Display();
//图层一设为工作图层
std::vector<Layer::StateInfo> stateArray1(2);
stateArray1[0] = Layer::StateInfo(2, Layer::StateSelectable);
stateArray1[1] = Layer::StateInfo(1, Layer::StateWorkLayer);
workPart->Layers()->ChangeStates(stateArray1, false);
//打开所有图层
std::vector<Layer::StateInfo> stateArray2(255);
for ( int i = 0 ; i <=254;i++)
{
stateArray2[i] = Layer::StateInfo(i+2, Layer::StateSelectable);
}
workPart->Layers()->ChangeStates(stateArray2, false);
//关闭所有图层
std::vector<Layer::StateInfo> stateArray2(255);
for ( int i = 0 ; i <=254;i++)
{
stateArray2[i] = Layer::StateInfo(i+2, Layer::StateHidden);
}
workPart->Layers()->ChangeStates(stateArray2, false);
//一键打开所有图层
//一键关闭所有图层