Set selection symbol of feature layer

421
1
02-18-2022 03:03 AM
KarthikAditya
New Contributor III

Using the Pro SDK 2.9, I'm trying to update the style of the selected features in a layer.

This example shows how to change the color of selected features - arcgis-pro-sdk-community-samples .Similarly, when I try to update the selection symbology of a line layer, the code does not work.

Below is the snippet of what I'm trying:

//layer is a FeatureLayer

var layerDef = layer.GetDefinition() as CIMBasicFeatureLayer;

layerDef.UseSelectionSymbol = true;
//layerDef.SelectionColor = ColorFactory.Instance.RedRGB;

layerDef.SelectionSymbol = new CIMSymbolReference()
{
Symbol = SymbolFactory.Instance.ConstructLineSymbol(
CIMColor.CreateRGBColor(255, 0, 0), 5, SimpleLineStyle.Dot),
SymbolName = "Dotted red line",
};

layer.SetDefinition(layerDef);

Am I missing anything?

0 Kudos
1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

There is no possibility to change symbol from ArcGIS Pro.

GintautasKmieliauskas_0-1645199446566.png

So, I think, these properties  (UseSelectionSymbol, SelectionSymbol) are reserved for future implementation.