I need help with saving rhino Objects User dictionary

Hello there!

I am very new to Speckle and trying to test the value of speckle for my team’s workflow. We are building a design tool in Rhino. As a part of this, we create rhino objects with custom data saved into the User Dictionary in the attributes of a rhino object. From very simple tests of uploading simple objects, it appears that speckle does not save much user data besides the geometry and layer. Does this feature exist? to save this data? or should I be looking at building my own layer on top of speckle to export-import? I am very new and would appreciate any tips as to the best direction to proceed!

Sorry for the lack of example files, though I think this question is on a simple enough level to survive without. Thank you in advance!

1 Like

Hi @JimboSlice! Okay, that probably is an oversight on our end. We’ll look into this asap. A quick question/request would be to give us a sample of the data you’re attaching to rhino objects so we can code the right thing!

Okay, following up: it seems we actually do swipe away properties that can be visible in the user attributes text panel in rhino:

and the sent stuff:

(you’ll notice they all have the foo, bar, baz props).

We don’t look yet into the UserDictionary itself. So our questions are:

  • could your workflows use the user strings instead? (this is what we’re parsing already)
  • if not, do you use nested user dictionaries?
1 Like

Thanks, @dimitrie for such a fast replay! In the meantime, I built a simple gh script to add and view User dictionary entries on objects though I feel you have no need for this as you see the issue.

Unfortunately, User strings from our experience are much heavier than a user dictionary. In addition, we also prefer to control more tightly the data from the dictionary which is harder for a typical user to edit.

Thanks again for the support

As a general rule, we are not using nested Dictionaries at all and are storing a serialized class as a JSON on the object which we can look out with our design tool and instantiate the appropriate class.

UserDicitonaryData_Speckle_ExampleFile.gh (9.1 KB)

1 Like

Okay, just had a quick chat with @AlanRynne and we’re working on a fix - it should be fast. Thanks for the script, i’ll use it to debug what we’re doing right now :slight_smile:

2 Likes

Okay, got things to work:

Simple props:

Nested dicts:

Last question: this currently works only when sending data from Rhino. I suspect you’d want this to work regardless of wether it’s coming from Gh or Rhino, no?

Fantastic! I will try this out when I have a moment. In general, we are trying to remove GH from our workflow so for our case, Rhino is perfect. I could easily imagine where GH could also be incredibly helpful but for us, this is enough! Thanks, Dimitrie

Hi @dimitrie , It may be that I simply am ignorant of the workflow as I have just picked up speckle but I am having trouble seeing the ‘meta’ data on my rhino object. So please forgive, if this is just a simple issue. I have tried receiving the object from your stream ‘simple props’ that you refer to in your answer. When I receive the geometry and check for any User dictionary entries I cannot find any. Is this just a matter of waiting until the next update? Thanks in advance

No worries! We have yet to push an update unfortunately - that’s why stuff is as it was on your end. I’ll coordinate with Alan on what we can push and when, and we’ll circle back here.

EDIT: Rhino: Handle UserDictionaries when sending and receiving · Issue #902 · specklesystems/speckle-sharp · GitHub it’s in progress :slight_smile:

1 Like

Hey there!

Just writing to let you know we just released version 2.2.8-beta for the Rhino connector. You should see it in the Speckle Manager in a couple minutes if everything goes well.

This adds support for user dictionaries, but do let us know what you think about it and if there’s any improvements to be made!

2 Likes

Bumping this old topic, but with a good suggestion (I hope) :innocent:

It would be great if the UserStrings are more easily accessible in GH (e.g. with a DSO component):

Now a small python script is used to read the data:

temp_k = []
temp_v = []
for pair in x:
    temp_k.append(pair.Key)
    temp_v.append(pair.Value)
k = temp_k
v = temp_v
3 Likes

Hi @JdB

I was under the impression that userDictionaries and userStrings were already converted to Base on the Rhino side of things.

Maybe it was just the UserDictionary? :thinking: Just came back from vacation so I’ll have to get my brain working first. :sweat:

I can also add a conversion routine from Dictionary<string, object> to Base to ease the pain a bit, but I don’t think we’ll ever “add direct support for dictionaries” in GH, as this is mostly a shortcoming on Grasshopper’s side. :cry:

1 Like

Heya, we’ve had an old issue open to send rhino dictionaries as Base: rhino: change user strings and user dictionaries to `Base` · Issue #1333 · specklesystems/speckle-sharp · GitHub

Will get cracking on this now, will be available with the next release!

2 Likes