Label | Explanation | Data Type |
Input 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 |
Output Layer
| The name of the scene layer to be created. | Scene Layer |
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 in the arcpy Layer class.
For more information about 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 Esri Cartographic Information Model (CIM). Additional CIM properties for each scene layer type are available that aren't exposed through ArcPy functions. See Python CIM access for more information about 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 type Supports associated feature layer 3D Object
Yes
Point
Yes
Point Cloud
No
Integrated Mesh
No
Building
Yes
Parameters
arcpy.management.MakeSceneLayer(in_dataset, out_layer)
Name | Explanation | Data 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
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")
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")
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.management.MakeSceneLayer('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.management.GetCount(out_layer)
print('{} has {} records'.format(out_layer, result[0]))