Clickable objects in an embedded solution

hello all.

I have a little problem to make objects clickable in an embedded solution. I’m trying to export my Gh definition (a building with multiple windows per floor and multiple floors) using the ShapeDiverDisplay component. But no matter the format of my grasshopper lists I can’t select windows 1 to 1 in the viewer.
Can someone guide me on this?

Please let me know which version of the viewer API you are using (version 2 or version 3) and a sample of how the data structure is setup for the objects you want to individually select. In any case, if each individual object is sent to a different branch of a tree, they should all be accessible (and selectable) individually through the API.

Hi Mathieu

We use the V3 api . About the data structure each object is in its own branch .
{floor;surface},but I use only one component per parent branch (one shapediverdisplay component per floor)
because I can have hundreds of objects (between 100 and 400).
You understand that I’m not going to take each object and assign it a shapediverdisplay component.
any idea ?

We have recently updated the plugin to make much more convenient to control the scene tree from Grasshopper by using a naming scheme. We will create a Grasshopper and API example to demonstrate how it works. Thank you for your patience.

OK, thanks
how soon will this happen?

My apologies for the late answer. We are still planning to create this documentation but we had to prioritize other developments in the past days. I will let you know when we make progress.

Hello, have you made any progress on the documentation?

@charpentologue @Loic_Le_Mortellec Our apologies for the delay, we finally have documentation about these features.

In order to have fine-grained control over the structure of the glTF files in the viewer, and be able to find and manipulate objects individually through the API, one needs to use the glTF 2.0 Display component and store name attributes in the objects to be manipulated. You can read more about the name attributes and how the are used in the generated glTF files in this documentation article:

Once a proper naming scheme is implemented in Grasshopper and communicated to the developer of the web application, it is straightforward to find the objects by name in the API and then to apply interactions to them individually. You will find more information about how to explore the scene tree and find specific objects here:

Let me know if you have follow up questions.