Programatically select a 3D building

On initialisation and loading of a layer which has 3D buildings I want to select one or more buildings programatically.

Basically achieving the same result as single or double clicking a building

Is this possible?

thanks for any help!

Do you have some ID for the building you want to highlight? If so, the easiest way would be to use the 3D Tiles styling language, to highlight the building:

https://sandcastle.cesium.com/index.html?src=3D%20Tiles%20Feature%20Styling.html

If you want to do a post processing feature like here: https://sandcastle.cesium.com/index.html?src=3D%20Tiles%20Feature%20Picking.html

You would need some way to get access to the Cesium3DTileFeature, which would involve iterating over all the tiles in view as discussed here:

https://groups.google.com/d/msg/cesium-dev/epFY6Tqpbzc/Vc33tq14AAAJ

Let me know which approach works for you.

Hi

thank you for useful links I think it might help solve my requirement. However I have no reference to a Tileset as I am using the 3dCityDB code to initialise a CitydbKmlLayer.

I can’t find a way to get the tilesets. Do you know how to to get a reference to them?

thanks again.

Have you tried uploading your CityGML buildings to Cesium ion (https://cesium.com/ion/) ? That will create a 3D Tileset of buildings.