Hi @Gircsi117
If we consider that clickable objects are the objects with any kind of visual representation, then I can suggest an approach on finding out the ids of clickable objects via the viewer directly. Please bear in mind that the following code is part of an area of the viewer API which we haven’t properly formalized yet, that’s why it’s not yet properly documented.
const root = viewer.getWorldTree().findId('ROOT')
const nodes = viewer
.getWorldTree()
.getRenderTree()
.getRenderViewNodesForNode(root, root)
const clickableIds = nodes.map((node: TreeNode) => node.model.raw.id)
This will provide you with the ids of the objects from the speckle stream which have a visual representation of any kind, which you can then feed into the filtering API any way you like.
There is a note though. Nodes inside block instances will have their node.model.raw.id
set their own id, concatenated with their block’s id (or multiple block ids if there is a deeper nested hierarchy). They will still work fine with the filtering API however.
I’m assuming you need specific colors for each group of objects, so you are using setUserObjectColors
with you own colors and id sets. If specific colors are not needed you could simply filter the objects based on properties you define and set during authoring of the model.
Cheers