<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get City Engine Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-city-engine-object-attributes-at/m-p/1115233#M10630</link>
    <description>&lt;P&gt;Can anybody suggest the solution for this problem.&lt;/P&gt;&lt;P&gt;Please give us advice.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Nov 2021 13:06:20 GMT</pubDate>
    <dc:creator>KarthikS</dc:creator>
    <dc:date>2021-11-09T13:06:20Z</dc:date>
    <item>
      <title>How to get City Engine Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-city-engine-object-attributes-at/m-p/1112629#M10610</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I created the sample WPF application using ArcGIS Runtime SDK for Dot Net.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I loaded the local slpk file with one building which is exported from City Engine.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I cannot able to get that object attributes at runtime which is given in City Engine.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;See below figure for what exactly I need?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="City Engine Scene" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26492i4EE1986311A9E47A/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="City Engine Scene" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;City Engine Scene&lt;/span&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How to get this object attributes in WPF app, when I click that building?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Already I referred the following link&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/net/wpf/sample-code/update-attributes-feature-service/" target="_self"&gt;https://developers.arcgis.com/net/wpf/sample-code/update-attributes-feature-service/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/net/wpf/sample-code/scene-layer-selection/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/net/wpf/sample-code/scene-layer-selection/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But can not able to get the City Engine object attributes .&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My code is below&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer();&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;foreach (var sl in MySceneView.Scene.OperationalLayers)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if (!string.IsNullOrEmpty(sl.Id))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;sceneLayer = (ArcGISSceneLayer)sl;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sceneLayer.ClearSelection();&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IdentifyLayerResult identifyResult = await MySceneView.IdentifyLayerAsync(sceneLayer, e.Position, 10, false, 1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IReadOnlyList&amp;lt;GeoElement&amp;gt; geoElements = identifyResult.GeoElements;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if (geoElements.Any())&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;GeoElement geoElement = geoElements.FirstOrDefault();&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if (geoElement != null)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;sceneLayer.SelectFeature((Feature)geoElement);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;var _selectedFeature = (ArcGISFeature)identifyResult.GeoElements.First();&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;string currentAttributeValue = _selectedFeature.Attributes["City"].ToString();&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;above code raise the following exception&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;The given key 'City' was not present in the dictionary.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please give us advice&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 12:16:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-city-engine-object-attributes-at/m-p/1112629#M10610</guid>
      <dc:creator>KarthikS</dc:creator>
      <dc:date>2021-10-30T12:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get City Engine Object Attributes at Runtime using ArcGIS Runtime SDK for .NET in WPF App</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-city-engine-object-attributes-at/m-p/1115233#M10630</link>
      <description>&lt;P&gt;Can anybody suggest the solution for this problem.&lt;/P&gt;&lt;P&gt;Please give us advice.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 13:06:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-city-engine-object-attributes-at/m-p/1115233#M10630</guid>
      <dc:creator>KarthikS</dc:creator>
      <dc:date>2021-11-09T13:06:20Z</dc:date>
    </item>
  </channel>
</rss>

