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

Retrieving / Setting symbology based on feature layer

$
0
0
Hello,

I am working on a small add-in that will retrieve information about feature layers (symbology, definition queries, etc.), which will allow users to import / export these settings between map documents. I am looking for some guidance in collecting the symbology properties per feature layer. I have the following code that is hit for each feature layer in a map document:

Code:

                var featureLayer = (IFeatureLayer)layer;
                var legendInfo = (ILegendInfo)featureLayer;

                for (int li = 0; li < legendInfo.LegendGroupCount; li++)
                {
                    var legendGroup = legendInfo.get_LegendGroup(li);
                    for (int lg = 0; lg < legendGroup.ClassCount; lg++)
                    {
                        var legendClass = legendGroup.get_Class(lg);
                    }
                }


Is it possible to collect symbology properties (i.e. in an .XML file), to reload into new feature layers in a new MXD? I was looking at the IFeatureRenderer's as well - is this a better method of obtaining symbology properties?

Any advice / direction is much appreciated! Thanks

Viewing all articles
Browse latest Browse all 1374

Trending Articles