This project is read-only.

Select multiple layers with cmSelection Tool

Jun 26, 2015 at 3:52 AM
Hi I'm using C# to develop an application but i'cant find a way to select multiple layers at the same time ant that they return me their handlers. Any advice? thank you
Jun 28, 2015 at 10:17 AM
Hi, you should handle SelectBoxFinal event and call Shapefile.SelectShapes for each layer. Here is a single layer example. To run it for multiple layers something like this should be used:
for (int i = 0; i < axMap1.NumLayers; i++)
    int layerHandle = axMap1.get_LayerHandle(i);
    var sf = axMap1.get_Shapefile(layerHandle);
    if (sf != null)
Version 4.9.3 also has built-in in selection mechanism (ChooseLayer event should be handled). It's described in my post here . However it won't suit your needs, since there is no way to run it for multiple layers.

Hope this helps,
Jul 19, 2015 at 9:55 PM
Thank you, that part of code just solved my problem.