Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

How do I refresh a GroupLayer in ArcScene?

$
0
0
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:
Code:

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.

Viewing all articles
Browse latest Browse all 1374

Trending Articles