Select buildings in a 3D Object Scene Layer, view their attributes in a table, and highlight the currently selected building in the scene.
How to use the sample
- Hold Shift and Left-click to select a building. The Building Select / Identify panel shows:
- A paged list of all features hit by the ray.
- A scrollable table of key–value attribute pairs for the current feature.
- Use the < and > buttons to switch between features when multiple features are returned.
- Use the menu icon to see a list of buildings.
- The currently selected building is highlighted in the scene.
How it works
- The sample uses
IdentifyLayersAsyncon theArcGISViewto perform a ray-based identify between the mouse ray start and end points, obtained fromDeprojectMousePositionToWorldand a line trace. - For each
ArcGISGeoElementreturned:- Its attribute dictionary is read, converted to strings, and stored in an array of
FAttributeRow { Key, Value }. - All features for the current click are stored as an array of
FFeatureAttributeSet, enabling paging when multiple features are hit.
- Its attribute dictionary is read, converted to strings, and stored in an array of
- The UI is a UMG widget:
- A
ListViewuses a simple row UObject withKeyandValueproperties. RefreshListViewFromAttributes()populates the list by setting those properties and adding each row as a list item.- Page text (e.g.
1 of 3) is updated based on the current feature index.
- A
- Highlighting workflow:
- On startup,
SetupHighlightAttributesOnMap():- Gets the building
UArcGIS3DObjectSceneLayerfrom the map. - Calls
SetAttributesToVisualize()on the layer’s API object with"OBJECTID"so the material can access each feature’s ID. - Applies a material to the layer via
SetMaterialReference().
- Gets the building
- When the user changes the selected feature,
ApplySelectionToMaterial():- Extracts the current feature’s
OBJECTIDfrom the attribute rows. - Writes this value into a
UMaterialParameterCollectionscalar parameterSelectedID.
- Extracts the current feature’s
- The material samples the feature attribute texture, reads the per-pixel
OBJECTID, compares it againstSelectedID, and renders only the matching feature with a highlight color.
- On startup,
Tags
identify, attributes, select, highlight, 3d buildings