Query to select particular object in speckle viewer

Hi , Is there any query to select particular object in speckle viewer.

Hi @Sachin_Kannaujiya

Yes, there are several possible ways to go about it. If you can give me a few more details about what you need to do with said objects I’ll gladly provide more guidance

Cheers

I need to select particular object like room stairs etc using object id and camera view should be from front. like this

Hi @Sachin_Kannaujiya

You can use selectObjects(objectIds: string[]) to select any object. Regarding controlling the camera there are the setView and zoom methods. Here is a complete example

viewer.selectObjects(['objectId'])
viewer.setView('front')
viewer.zoom(['objectId'])

By defaults this animates the camera towards that position. If you don’t want it to animate, setView and zoom have an optional transition argument which you can set to false, disabling camera animation.

For various such operations please feel free to checkout the viewer documentation

Cheers

I did it but got this

Can you share the stream you’re working on and the object id you’re using? On my side everything works fine

would you please share screenshot .