How to add a new layer to GoDocument


I’m struggling with adding a new layer other than default and links layer to a GoDocument.

I’d like to load a shape file to my document as a separate layer. I used

GoLayer vLayer = goDocument.Layers.CreateNewLayerBefore(goDocument.DefaultLayer);

and added all shapes to this layer. But I did not see anything showing up.

If I used

GoLayer vLayer = goView.Layers.CreateLayerAfter(goView.BackgroundLayer);

And added all shapes to this layer. I could see them showing in the view.

Can anyone give me a help on this?

Thanks a lot,


I tried your first line of code, and it works fine for me… maybe your are creating Sheets in front of that layer?