2

I have a set of shapefiles with elevation values in its attribute. In ArcGIS Pro, I have placed these shapefiles into a Scene as a 3D layer. Then I have added extrusion, and the shapefiles are rendered correctly with height.

I tried to load the shapefiles into a Scene in ArcGIS Runtime, and did the extrusion in code. However, the symbology (or the color) is lost. I am aware that I can hard-code each shapefile's symbology in code, but that sounds wrong to me.

Is there a way for me to export these from ArcGIS Pro and use them in ArcGIS Runtime without hard-coding anything?

Update

This is what I am currently doing in code:

private async void LoadShapefiles(Scene sc) {
    foreach (var file in GetPaths()) {
        ShapefileFeatureTable myShapefile = await ShapefileFeatureTable.OpenAsync(file);

        FeatureLayer layer = new FeatureLayer(myShapefile);
        var symbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, Colors.Gray, null); // Hard-coded
        var renderer = new SimpleRenderer(symbol);


        renderer.SceneProperties.ExtrusionMode = Esri.ArcGISRuntime.Symbology.ExtrusionMode.Maximum;
        renderer.SceneProperties.ExtrusionExpression = "[HEIGHT]";

        layer.Renderer = renderer;
        layer.RenderingMode = FeatureRenderingMode.Dynamic;

        sc.OperationalLayers.Add(layer);
    }
}

private string[] GetPaths() {
    return Directory.GetFiles(@"D:\Test", "*.shp");
}

This causes all features to be rendered with the same color.

  • You could try loading them as a layer instead of as a feature class.. do you have any code so we can see where to implement potential fixes? – Michael Stimson Jul 30 '18 at 3:39
  • @MichaelStimson Updated. – Jai Jul 30 '18 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.