Make Scene Layer (Data Management)

Summary

Creates a scene layer from a scene layer package (.slpk) or scene service.

Usage

  • The temporary scene layer can be saved as a layer file using the Save To Layer File tool.

  • To create a point or 3D object scene layer with an associated feature layer, share the web layer or web scene to a portal.

  • Scene layers can be identified in a global or local scene using the isSceneLayer property on the Layer class.

  • For more information on scene layers, see What is a scene layer?

  • The properties and methods available on a scene layer depend on the scene layer type and are available through ArcPy functions or the CIM. Additional CIM properties for each scene layer type are available that aren't already exposed through ArcPy functions. See Python CIM access for more information on accessing a layer's CIM. If the scene layer has an associated feature layer, the scene layer can also be used as input to any geoprocessing tool that supports the scene layer's geometry type.

    Scene layer typeSupports associated feature layer

    3D Object

    Yes

    Point

    Yes

    Point Cloud

    No

    Integrated Mesh

    No

    Building

    No

Syntax

MakeSceneLayer(in_dataset, out_layer)
ParameterExplanationData Type
in_dataset

The input scene layer package (.slpk) or scene service from which the new scene layer will be created.

Scene Layer; Building Scene Layer; File
out_layer

The name of the scene layer to be created.

Scene Layer

Code sample

MakeSceneLayer example 1 (Python window)

The following Python window script demonstrates how to use the MakeSceneLayer function with a scene layer package as input.

import arcpy
arcpy.management.MakeSceneLayer(r"c:\temp\buildings.slpk", "buildings_Layer")
MakeSceneLayer example 2 (Python window)

The following Python window script demonstrates how to use the MakeSceneLayer function with a scene service as input.

import arcpy
arcpy.management.MakeSceneLayer("https://MyServer.com/server/rest/services/Hosted/City_WSL1/SceneServer/layers/0", 
                                "City_Layer")
MakeSceneLayer example 3 (stand-alone script)

The following stand-alone script demonstrates how to use the MakeSceneLayer function to create a layer that can be used by the GetCount tool.

# Name: GetSceneLayerCount.py
# Description: Gets the number of features from a scene service

# Import system modules
import arcpy

out_layer = 'Hamburg_Buildings'

# Make a layer from a scene service
arcpy.MakeSceneLayer_management('http://scene.arcgis.com/arcgis/rest/services/Hosted/Building_Hamburg/SceneServer/layers/0',
                                out_layer)
print("Created Scene Layer")

# Get the number of features from the scene service
result = arcpy.GetCount_management(out_layer)
print('{} has {} records'.format(out_layer, result[0]))

Environments

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics