Add a layer to a local scene to visualize and interact with 3D building models developed using Building Information Modeling (BIM) tools.
Use case
Building Scene Layers allow you to display and analyze detailed building models created from 3D BIM data. Unlike 3D object scene layers, which represent all features within a single layer, Building Scene Layers are organized into a hierarchy of sublayers representing individual building components such as walls, light fixtures, and mechanical systems. These sublayers are often grouped by disciplines like Architectural, Mechanical, or Structural. This structure enables deeper interaction and analysis of both interior and exterior features, providing insight into how a building is designed, used, and situated in its spatial context.
How to use the sample
When loaded, the sample displays a scene with a Building Scene Layer. By default, the Overview sublayer is visible, showing the building's exterior shell. Use the "Full Model" toggle to switch to the Full Model sublayer, which reveals the building's components. Pan around and zoom in to observe the detailed features such as walls, light fixtures, mechanical systems, and more, both outside and inside the building.
How it works
- Create a local scene object with the
ArcGISScene(BasemapStyle, SceneViewingMode)constructor. - Create an
ArcGISTiledElevationSourceobject and add it to the local scene's base surface. - Create a
BuildingSceneLayerand add it to the local scene's operational layers. - Create a
LocalSceneViewobject to display the scene. - Set the local scene to the
LocalSceneView.
Relevant API
- ArcGISTiledElevationSource
- BuildingSceneLayer
- BuildingSublayer
- LocalSceneView
- Scene
Tags
3D, buildings, elevation, layers, scene, surface
Sample Code
/* Copyright 2025 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.esri.arcgismaps.sample.addbuildingscenelayer
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import com.arcgismaps.ApiKey
import com.arcgismaps.ArcGISEnvironment
import com.esri.arcgismaps.sample.addbuildingscenelayer.screens.AddBuildingSceneLayerScreen
import com.esri.arcgismaps.sample.sampleslib.theme.SampleAppTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// authentication with an API key or named user is
// required to access basemaps and other location services
ArcGISEnvironment.apiKey = ApiKey.create(BuildConfig.ACCESS_TOKEN)
enableEdgeToEdge()
setContent {
SampleAppTheme {
AddBuildingSceneLayerApp()
}
}
}
@Composable
private fun AddBuildingSceneLayerApp() {
Surface(color = MaterialTheme.colorScheme.background) {
AddBuildingSceneLayerScreen(
sampleName = getString(R.string.add_building_scene_layer_app_name)
)
}
}
}