<?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: SDK equivalent to Changing Layer's Elevation Properties &amp;quot;Features are&amp;quot; setting (At an Absolute Height, On the Ground, or Relative to the in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/sdk-equivalent-to-changing-layer-s-elevation/m-p/1347312#M10666</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you pick the On the Ground option, the CIM definition of the layer looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;LayerElevation xsi:type="typens:CIMLayerElevationSurface"&amp;gt;
    &amp;lt;OffsetZ&amp;gt;0&amp;lt;/OffsetZ&amp;gt;
    &amp;lt;ElevationSurfaceLayerURI&amp;gt;CIMPATH=Map/dc9328b7a8a849d78652499f3fa0ca9e.json&amp;lt;/ElevationSurfaceLayerURI&amp;gt;
    &amp;lt;IsRelativeToScene&amp;gt;false&amp;lt;/IsRelativeToScene&amp;gt;
  &amp;lt;/LayerElevation&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In code, you can set these CIM values like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var layer = MapView.Active?.Map?.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault();
var surface = MapView.Active.Map.GetGroundElevationSurfaceLayer();
if (layer == null || surface == null)
return;
await QueuedTask.Run(() =&amp;gt;
{
//Get the layer's CIM Definition
var layerDefn = layer.GetDefinition() as CIMFeatureLayer;
//Set the LayerElevation properties
layerDefn.LayerElevation.ElevationSurfaceLayerURI = surface.URI;
layerDefn.LayerElevation.OffsetZ = 0;
layerDefn.LayerElevation.IsRelativeToScene = false;
//This is important - set the FeatureElevationExpression to an empty string
layerDefn.FeatureElevationExpression = string.Empty;
layer.SetDefinition(layerDefn);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you pick the Relative to the Ground option, there is an additional attribute on the CIM that specifies the attribute to use for feature elevation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;FeatureElevationExpression&amp;gt;Shape.Z&amp;lt;/FeatureElevationExpression&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In code, you set this CIM value like this - (in addition to setting the LayerElevation mentioned above).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;layerDefn.FeatureElevationExpression = "Shape.Z";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 19:14:08 GMT</pubDate>
    <dc:creator>UmaHarano</dc:creator>
    <dc:date>2023-11-08T19:14:08Z</dc:date>
    <item>
      <title>SDK equivalent to Changing Layer's Elevation Properties "Features are" setting (At an Absolute Height, On the Ground, or Relative to the Ground)</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/sdk-equivalent-to-changing-layer-s-elevation/m-p/1346139#M10655</link>
      <description>&lt;P&gt;Pro 3.1.3 on Windows 11&lt;BR /&gt;&lt;BR /&gt;I am able to convert a 2D Map into a 3D Local Scene using MapFactory.Instance.ConvertMap()&lt;BR /&gt;&lt;BR /&gt;I then get the Ground Surface Layer, set the default Elevation Source Layer to visibility(false), add a raster layer as a new Elevation Source Layer to the Ground Surface.&lt;BR /&gt;&lt;BR /&gt;Only a couple steps seem to be left:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;For each Layer in the Scene, Set the Elevation Properties setting (as it shows in Pro) "Features are" to "on the Ground", the default appears to be "at an Absolute Height"&amp;nbsp; I have spent way too many hours trying to find a workflow that accomplishes this.&amp;nbsp; I'm stumped.&lt;/LI&gt;&lt;LI&gt;Change the Scene camera angle to an initial angle that shows the terrain relief (haven't attempted this yet, but if someone has a solution along with a solution for #1, that's great)&lt;/LI&gt;&lt;/OL&gt;&lt;LI-CODE lang="csharp"&gt;await QueuedTask.Run(() =&amp;gt;
{
    if (MapFactory.Instance.CanConvertMap(newMap, MapConversionType.SceneLocal))
    {
        newScene = MapFactory.Instance.ConvertMap(newMap, MapConversionType.SceneLocal, true);
        newScene.SetSpatialReference(SpatialReferences.WGS84);
        var groundSurfaceLayer = newScene.GetGroundElevationSurfaceLayer();
        groundSurfaceLayer.SetVerticalExaggeration(2.00);
        groundSurfaceLayer.SetCIMColor(CIMColor.NoColor());
        groundSurfaceLayer.Layers.FirstOrDefault().SetVisibility(false);
        var elevationLayerCreationParams = new ElevationLayerCreationParams(new Uri(System.IO.Path.Combine(CommonVariables.geoDatabasePath, CommonVariables.krigLayerName)));
        var eleSourceLayer = LayerFactory.Instance.CreateLayer&amp;lt;Layer&amp;gt;(elevationLayerCreationParams, groundSurfaceLayer);
        List&amp;lt;Layer&amp;gt; layerList = newScene.GetLayersAsFlattenedList().OfType&amp;lt;Layer&amp;gt;().ToList();
        foreach (Layer lyr  in layerList)
        {
            lyrName = lyr.Name;
        }
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I did find the ArcGIS.Core.CIM.AltitudeMode Enum with the 3 possible values I'm looking for, and that is referenced by ArcGIS.Core.CIM.CIMAltitudeParams Class Mode Property... but I'm not seeing anywhere that CIMAltitudeParams is referenced.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 16:17:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/sdk-equivalent-to-changing-layer-s-elevation/m-p/1346139#M10655</guid>
      <dc:creator>ShaunHustad</dc:creator>
      <dc:date>2023-11-06T16:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: SDK equivalent to Changing Layer's Elevation Properties "Features are" setting (At an Absolute Height, On the Ground, or Relative to the</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/sdk-equivalent-to-changing-layer-s-elevation/m-p/1346985#M10664</link>
      <description>&lt;P&gt;UPDATE:&lt;BR /&gt;&lt;BR /&gt;I found a way to set each Layer's Elevation Properties to "Relative to the Ground".&amp;nbsp; Still not sure how to set a Layer's Elevation Properties to "On the Ground"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;await QueuedTask.Run(() =&amp;gt;
{
    if (MapFactory.Instance.CanConvertMap(newMap, MapConversionType.SceneLocal))
    {
        newScene = MapFactory.Instance.ConvertMap(newMap, MapConversionType.SceneLocal, true);
        newScene.SetSpatialReference(SpatialReferences.WGS84);
        var groundSurfaceLayer = newScene.GetGroundElevationSurfaceLayer();
        groundSurfaceLayer.SetVerticalExaggeration(2.00);
        groundSurfaceLayer.SetCIMColor(CIMColor.NoColor());
        groundSurfaceLayer.Layers.FirstOrDefault().SetVisibility(false);
        var elevationLayerCreationParams = new ElevationLayerCreationParams(new Uri(System.IO.Path.Combine(CommonVariables.geoDatabasePath, CommonVariables.krigLayerName)));
        var eleSourceLayer = LayerFactory.Instance.CreateLayer&amp;lt;Layer&amp;gt;(elevationLayerCreationParams, groundSurfaceLayer);
        var layerElevationSurface = new CIMLayerElevationSurface
        {
            ElevationSurfaceLayerURI = groundSurfaceLayer.URI,
        };
        List&amp;lt;Layer&amp;gt; layerList = newScene.GetLayersAsFlattenedList().OfType&amp;lt;Layer&amp;gt;().ToList();
        foreach (Layer lyr  in layerList)
        {
            if (lyr is FeatureLayer fl)
            {
                var cimLyr = fl.GetDefinition() as CIMFeatureLayer;
                cimLyr.LayerElevation = layerElevationSurface;
                fl.SetDefinition(cimLyr);
            }
            lyrName = lyr.Name;
        }
    }
});&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Nov 2023 01:30:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/sdk-equivalent-to-changing-layer-s-elevation/m-p/1346985#M10664</guid>
      <dc:creator>ShaunHustad</dc:creator>
      <dc:date>2023-11-08T01:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: SDK equivalent to Changing Layer's Elevation Properties "Features are" setting (At an Absolute Height, On the Ground, or Relative to the</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/sdk-equivalent-to-changing-layer-s-elevation/m-p/1347312#M10666</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you pick the On the Ground option, the CIM definition of the layer looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;LayerElevation xsi:type="typens:CIMLayerElevationSurface"&amp;gt;
    &amp;lt;OffsetZ&amp;gt;0&amp;lt;/OffsetZ&amp;gt;
    &amp;lt;ElevationSurfaceLayerURI&amp;gt;CIMPATH=Map/dc9328b7a8a849d78652499f3fa0ca9e.json&amp;lt;/ElevationSurfaceLayerURI&amp;gt;
    &amp;lt;IsRelativeToScene&amp;gt;false&amp;lt;/IsRelativeToScene&amp;gt;
  &amp;lt;/LayerElevation&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In code, you can set these CIM values like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var layer = MapView.Active?.Map?.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault();
var surface = MapView.Active.Map.GetGroundElevationSurfaceLayer();
if (layer == null || surface == null)
return;
await QueuedTask.Run(() =&amp;gt;
{
//Get the layer's CIM Definition
var layerDefn = layer.GetDefinition() as CIMFeatureLayer;
//Set the LayerElevation properties
layerDefn.LayerElevation.ElevationSurfaceLayerURI = surface.URI;
layerDefn.LayerElevation.OffsetZ = 0;
layerDefn.LayerElevation.IsRelativeToScene = false;
//This is important - set the FeatureElevationExpression to an empty string
layerDefn.FeatureElevationExpression = string.Empty;
layer.SetDefinition(layerDefn);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you pick the Relative to the Ground option, there is an additional attribute on the CIM that specifies the attribute to use for feature elevation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;FeatureElevationExpression&amp;gt;Shape.Z&amp;lt;/FeatureElevationExpression&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In code, you set this CIM value like this - (in addition to setting the LayerElevation mentioned above).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;layerDefn.FeatureElevationExpression = "Shape.Z";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 19:14:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/sdk-equivalent-to-changing-layer-s-elevation/m-p/1347312#M10666</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2023-11-08T19:14:08Z</dc:date>
    </item>
  </channel>
</rss>

