How to get City Engine Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App

10-30-2021 05:14 AM
New Contributor II


I created the sample WPF application using ArcGIS Runtime SDK for Dot Net.

I loaded the local slpk file with one building which is exported from City Engine.

I cannot able to get that object attributes at runtime which is given in City Engine.

See below figure for what exactly I need?

City Engine SceneCity Engine Scene


How to get this object attributes in WPF app, when I click that building?

Already I referred the following link

But can not able to get the City Engine object attributes .

My code is below

ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer();

foreach (var sl in MySceneView.Scene.OperationalLayers)
if (!string.IsNullOrEmpty(sl.Id))
sceneLayer = (ArcGISSceneLayer)sl;


IdentifyLayerResult identifyResult = await MySceneView.IdentifyLayerAsync(sceneLayer, e.Position, 10, false, 1);

IReadOnlyList<GeoElement> geoElements = identifyResult.GeoElements;

if (geoElements.Any())
GeoElement geoElement = geoElements.FirstOrDefault();
if (geoElement != null)

var _selectedFeature = (ArcGISFeature)identifyResult.GeoElements.First();

string currentAttributeValue = _selectedFeature.Attributes["City"].ToString();

above code raise the following exception

The given key 'City' was not present in the dictionary.

Please give us advice



0 Kudos
1 Reply
New Contributor II

Can anybody suggest the solution for this problem.

Please give us advice.

0 Kudos