FeatureLayer.AddLabelClass always adds label class with Class 1 name ignoring the name passed to the method. Am I missing something?
I couldn't reproduce this problem. I was able to add a new Label Class using this method. The Label Class has the name passed to the AddLabelClass method. Can you please share a code snippet?
I've performed more testing and results even more interesting. It seems AddLabelClass method actually just do kind of request to add class, but doesn't add it actually. Here is screenshot:
If I try to get added class immediately after AddLabelClass, LabelClasses collection will not contain it! But after couple of seconds:
So now it's OK...
In the middle between these two points in time class is added but has Class 1 name. So the entire process in SDK looks like this:
It's absolutely unobvious that AddLabelClass exits without class actually added. These "somewhere in the future" are not good.
I can duplicate your problem using ArcGIS Pro 2.3 Final. However using the exact same code I am unable to see the same problem in a pre-2.4 build. ArcGIS Pro 2.4 will be released shortly. Please let us know if you continue to see this problem when you upgrade to ArcGIS Pro 2.4
Retrieving data ...