Selection API of the player

This is regarding Player API Selection Set.
https://docs.threekit.com/docs/player-api#module_Selection..set

I am trying to add a mesh to the Selection set but its not getting added. I have passed the nodeid, node name but not working.

HTML code
handlers: {
mousedown: e => {
const hits = e.hitNodes;
if (!hits.length) return;
const hierarchy = […hits[0].hierarchy];
hierarchy.reverse();
for (let node of hierarchy) {
if (node.type === “PolyMesh”) {
api.selectionSet.add({ name: node.nodeId });
}
}

Tried in Console also
image

Hi Prashant, sorry for your challenge I believe there is a gap in our documentation thank you for pointing it out.

Instead of calling api.selectionSet.add(NODE_ID) can you please try: api.selectionSet.set(NODE_ID) or api.selectionSet.add(NODE_ID) and see if that is giving you the results you want? I believe IDs are what will create the selection. I am investigating with our team to confirm.

Thanks @Will its working as per your suggestion. When we add i get undefined in response. is there a way to get confirmation response.
image

Great, I’m glad it’s working. At this time there is no way to get a confirmation response.