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.
Asked
Active
Viewed 241 times
1
-
Yes, that's so, layers collection belongs to model. What is your goal? – ilCosmico Feb 15 '20 at 21:41
-
Not sure I understand the question or problem. Could you add more description to what you are trying to do and what is going wrong? – Sneaky Polar Bear Mar 06 '20 at 19:03
1 Answers
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