RhinoCommon UserData List

Hi,

I have two short questions regarding the User Data:

  1. What if want to have a List as a part of the UserData? Let us say List guids. How would this example look like? How would Read and Write functions look like?

  2. Is UserData attachable only to RhinoObjects? Or can some user data be attached to an (empty) Document?

Thanks.

Hi @dimcic,

  1. It depends: there are some methods on the archivableDictionary class that allow for storage of collections. For example If you have a list of guid you can store it like this:
    https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Collections_ArchivableDictionary_Set_23.htm
    For every type not directly supported you need to do custom serialization and store them via
    https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Collections_ArchivableDictionary_Set_21.htm

  2. Userdata can be attached to

  • Geometry
  • Attributes
  • Viewports
  • a rhino doc

And probably even more. You can search the RhinoCommon docs classes you want to store userdata on if they have the UserData property.

Hope this helps