andreaspaulsen

How do I  refresh a GroupLayer in ArcScene?

Discussion created by andreaspaulsen on Mar 13, 2014
I have working code that creates a new grouplayer and add some custom layers to it.
However when I later create a new custom layer and add it to an existing grouplayer; it is not drawn and I have to right-click on the group layer and press refresh.

I have code that I use to refresh the drawing which works for non group layers:
void Util::refresh(IScenePtr scene, ILayerPtr layer) 
{
 ISceneGraphPtr sgraph;
 scene->get_SceneGraph(&sgraph);
 sgraph->Invalidate(layer, VARIANT_TRUE, VARIANT_TRUE);
 ISceneViewerPtr viewer;
 sgraph->get_ActiveViewer(&viewer);
 sgraph->Invalidate(viewer, VARIANT_TRUE, VARIANT_TRUE);
 sgraph->RefreshViewers();
}


I have tried to call this with both the group layer and the new custom layer without any success.

Outcomes