ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / ExportScene3DObjects Method
The options for the export.
Example

In This Topic
    ExportScene3DObjects Method
    In This Topic
    Exports the scene contents to an exchange format.Supported export formats: glTF and stereolithography(STL).
    Syntax
    Public Sub ExportScene3DObjects( _
       ByVal exportFormat As ExportSceneContentsFormat _
    ) 
    public void ExportScene3DObjects( 
       ExportSceneContentsFormat exportFormat
    )

    Parameters

    exportFormat
    The options for the export.
    Exceptions
    ExceptionDescription
    Export 3D objects is only supported for Local scenes.
    The export format can not be null.
    The Extent to export can not be null.
    The folder path is not accessible.
    Example
    Export the map view associated with a map frame to BMP
    {
      //Export the map view associated with a map frame to BMP.
      string filePath = @"Path and file name for the output export file";
      //Create BMP format with appropriate settings
      //EMF, EPS, GIF, JPEG, PDF, PNG, SVG, TGA, and TFF formats are also available for export
      BMPFormat BMP = new BMPFormat()
      {
        Resolution = 300,
        Height = 500,
        Width = 800,
        HasWorldFile = true,
        OutputFileName = filePath
      };
    
      //Export on the worker thread
      await QueuedTask.Run(() =>
      {
        MapView mv_bmp = mapFrame.GetMapView(layoutView);
        if (mv_bmp != null)
        {
          //Check to see if the path is valid and export
          if (BMP.ValidateOutputFilePath())
          {
            mv_bmp.Export(BMP);  //Export to BMP
          }
        }
      });
    }
    Export the contents of a scene to an exchange format such as glTF and STL.
    {
      // Validate the current active view. Only a local scene can be exported.
      bool CanExportScene3DObjects = MapView.Active?.ViewingMode == MapViewingMode.SceneLocal;
      if (CanExportScene3DObjects)
      {
        // Create a scene content export format, export the scene context as a glTF file
        var exportFormat = new ExportSceneContentsFormat()
        {
          Extent = mapView.Extent, // sets Extent property
          FolderPath = @"C:\Temp", // sets FolderPath property
                                   //sets FileName property.The export format is determined by the output file extension (e.g.,.stl, .gltf)
          FileName = "my-3d-objects.gltf",
          IsSingleFileOutput = true, // sets whether to export to one single file
          SaveTextures = true //sets whether to save textures
        };
        // Export the scene content as 3D objects
        mapView.ExportScene3DObjects(exportFormat);
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.5 or higher.
    See Also