I’m stuck on a little problem: I want to read/modify UserText data of objects from Rhinocommon, but for the moment all my attempts stayed ineffective…
I tried to access to the UserDictionary of the object, but it doesn’t return me anything… In fact, I’m not sure to get the difference between UserData, UserDataList and UserDictionary.
Could someone have the kindness to explain how work these objects and maybe write a short example showing how to read/modify UserTest via Rhinocommon?
UserString is the most simple way to attach data to an object: you can only store strings.
Next up is the UserDictionary, in which you can store key-value pairs. The keys are always strings, but the values can be may different types, including other dictionaries.
The most complex way to attach data is to use a custom UserData class, which needs to be able to read and write itself to file. With this, you can do anything that is serializable.
Each of them caters to specific use cases. Don’t use the more complex way to achieve something simple is what I would say. Personally, I always use the UserDictionary and have never had the need for the more complex UserData.
Hi,
I am new to rhino development and I was searching for “how can I remove some UserString that I have attached to the object”. can you help me with that, please?