Handling layers without reference parameters

Q:  How can I handling layers without methods using parameters as reference?

A: If you use JavaScript or C#, there is an easy way to handle layers. There are methods that do not use parameters as references. Use the SetLayersExt method instead of SetLayers to set viewable layers. In this case you should use SetNumberOfLayers, GetLayerNumberAt and SetLayerNumberAt methods for creating the array of the viewable layers.

Code example in C#

// Create array for 2 layers

bool bRet = view.BiAnno.SetNumberOfLayers(2);

if (bRet)

{

            // Set the layer number

            view.BiAnno.SetLayerNumberAt(1, 0);

            view.BiAnno.SetLayerNumberAt(2, 1);

 

            // Set the layers

view.BiAnno.SetLayersExt();

 

// Select the active layer

// Active layer will be the 2

view.BiAnno.SelectLayer(2);

}