1

I have a common eyeshot model (with entities) with multiple layers, i want to display multiple viewports and set which layers have to be visible. As i understand, layers are defined by model and not viewport ? Best regards.

hamid badi
  • 39
  • 3

1 Answers1

0

It sounds like this could do the trick. Let me know! Take out the regen and invalidate if you aren't looking to update the viewport instantly.

public void makeLayerVisible(ref ViewportLayout vp, string layerName)
{
  for(int i = 0; i < vp.Entities.Count; i++)
  {
    if (vp.Entities[i].LayerName == layerName)
    {
      vp.Entities[i].Visible = true;
    }
  }
  vp.Entities.Regen();
  vp.Invalidate();
}


public void makeLayerHidden(ref ViewportLayout vp, string layerName)
{
  for (int i = 0; i < vp.Entities.Count; i++)
  {
    if (vp.Entities[i].LayerName == layerName)
    {
      vp.Entities[i].Visible = false;
    }
  }
  vp.Entities.Regen();
  vp.Invalidate();
}
Brendan Getz
  • 71
  • 1
  • 5