Is there a way to store various datas in invisible entities?

Hi all,

I’m using RhinoCommon dll with C#.
My program creates many datas which are not intended for being displayed. I’d like to store those datas when a document in Rhino is saved.

I know that in AutoCAD, there is XDATA properties for all objects that allows to store various datas. Besides, invisible point objects also exist, so it’s quite easy to store any property in a DWG file (which is the extension of AutoCAD files).

Is there a similar way to store various datas in a 3dm file ?

Thank you in advance for your answers !

I found something which seems to be similar to XDATA with ObjectAttributes class and UserDatas attribute.

You have a choice:

if the data is bound to a geometry item, you can store it in one of three ways:

  1. UserStrings
  2. UserDictionary

3… UserData

The first can only store string info. The second can store many simple data types (int, double, bool, Guid, arrays of these, etc.). The third is to store any class structure you want, but you have to provide serialization/deserialization in the class (possibly by just decorating it with [Serializable]).

If you have non-geometry data, you can also write plug-in data to the 3dm file and read it when the 3dm file is opened.


Thank you for you explanations, it works fine!