Select to view content in your preferred language

How to set an expression in Unique Value symbology?

145
1
Jump to solution
01-27-2025 03:17 PM
Gfreitag
Emerging Contributor

Hello,

I'm trying to create a UniqueValueRendererDefinition that uses the OBJECTID as a value. However, Pro does not give this option by default, and it also does not work in the SDK if I give OBJECTID as the value field (It uses some other field instead). In Pro, I would solve this by going into symbology and setting the field to an expression and selecting OBJECTID:

Gfreitag_0-1738019666332.png

How could I do this using the SDK? My hunch is it will be something relating to the CIM, but I can't find any resources for this online.

Thanks!

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

You are talking about CIMLabelClass Expression method. Link contains samples.

I would recommend using CIM viewer for questions related to layer symbology. Change something in ArcGIS Pro layer symbology and find changed part in CIM objects tree of CIM Viewer. Download CIM Viewer code from here. Video about CIM Viewer here.

View solution in original post

1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

You are talking about CIMLabelClass Expression method. Link contains samples.

I would recommend using CIM viewer for questions related to layer symbology. Change something in ArcGIS Pro layer symbology and find changed part in CIM objects tree of CIM Viewer. Download CIM Viewer code from here. Video about CIM Viewer here.