Cannot get custom attributes from Sketchup to Grasshopper


I try to send a Sketchup object to Grasshopper, the attributes show up on the webapp, but I can’t figure out how to get them in Grasshopper.

It seels that the Sketchup connector is structuring them as a Dictionary and not as a Speckle Object, so you could try using a python node and something like this to get key pairs out:

mydata.keys()
mydata.values()

1 Like

thanks for replying, I’m pretty new to this Python stuff, can you provide some examples of this?

Hey @Bao_Trinh_Quoc ,

Looks like we need to send these attributes as Speckle objects. Until we implement that, you can use the Python node in Grasshopper to access these attributes. You can see the structure of the SketchUp attributes using our web app.

Here’s an example script that shows how you can do that:

a = x["dictionaries"]["SU_InstanceSet"]["Owner"]

3 Likes

thank you so much, it works perfectly in Grasshopper Rhino 7, but seem like it doesn’t work in Grasshopper Rhino 8. It’s good for now but do you have any suggestions on this.

1 Like

you should use IronPython 2 Script node instead of Python 3 Script.

1 Like