Pro 3.1.3 on Windows 11
I am able to convert a 2D Map into a 3D Local Scene using MapFactory.Instance.ConvertMap()
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.
Only a couple steps seem to be left:
- 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" I have spent way too many hours trying to find a workflow that accomplishes this. I'm stumped.
- 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)
await QueuedTask.Run(() =>
{
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<Layer>(elevationLayerCreationParams, groundSurfaceLayer);
List<Layer> layerList = newScene.GetLayersAsFlattenedList().OfType<Layer>().ToList();
foreach (Layer lyr in layerList)
{
lyrName = lyr.Name;
}
}
}); 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.