# C++ UserData

**URL:** <https://discourse.mcneel.com/t/c-userdata/214684>\
**Category:** Rhino Developer\
**Tags:** windows\
**Created:** [January 19, 2026, 6:40am UTC](https://discourse.mcneel.com/t/c-userdata/214684 "2026-01-19T06:40:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niko\_Striega](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/niko_striega/32/638220_2.png) [@Niko\_Striega](https://discourse.mcneel.com/u/Niko_Striega)\
**Post date:** [January 19, 2026, 6:40am UTC](https://discourse.mcneel.com/t/c-userdata/214684/1 "2026-01-19T06:40:28Z")

</div>

Hi Guys,

Does anyone have an example or guidance for attaching UserData to a .3dm file?

I need to attach Int’s and Strings to the .3dm file. I would like to avoid linking to the geometry if possible.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [January 19, 2026, 4:06pm UTC](https://discourse.mcneel.com/t/c-userdata/214684/2 "2026-01-19T16:06:56Z")

</div>

Hi @Niko_Striega,

Start here:

> **[User Data](https://developer.rhino3d.com/guides/cpp/user-data/)**
>
> This guide covers user data using C/C++.

There are samples in the developer samples repo on GitHub.

> **[GitHub - mcneel/rhino-developer-samples: Rhino and Grasshopper developer sample code](https://github.com/mcneel/rhino-developer-samples)**
>
> Rhino and Grasshopper developer sample code

– Dale

---

<div class="post-metadata">

**Author:** ![Niko\_Striega](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/niko_striega/32/638220_2.png) [@Niko\_Striega](https://discourse.mcneel.com/u/Niko_Striega)\
**Post date:** [January 20, 2026, 6:23am UTC](https://discourse.mcneel.com/t/c-userdata/214684/3 "2026-01-20T06:23:53Z")

</div>

Hi Dale,

Thanks for your response! It is much appreciated.  
I think I am still missing something. I see the Object UserData is well explained, but I am getting lost on the Document UserData. Are there any Examples of Document UserData ?

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [January 20, 2026, 4:12pm UTC](https://discourse.mcneel.com/t/c-userdata/214684/4 "2026-01-20T16:12:10Z")

</div>

Hi @Niko_Striega,

This large sample reads and writes document user data.

> **[rhino-developer-samples/cpp/SampleCommands at 8 · mcneel/rhino-developer-samples](https://github.com/mcneel/rhino-developer-samples/tree/8/cpp/SampleCommands)**
>
> Rhino and Grasshopper developer sample code. Contribute to mcneel/rhino-developer-samples development by creating an account on GitHub.

There are probably other samples. Just look for plug-in that override these:

```auto
CRhinoPlugIn::CallWriteDocument
CRhinoPlugIn::WriteDocument
CRhinoPlugIn::ReadDocument

```

– Dale

---

<div class="post-metadata">

**Author:** ![Niko\_Striega](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/niko_striega/32/638220_2.png) [@Niko\_Striega](https://discourse.mcneel.com/u/Niko_Striega)\
**Post date:** [January 21, 2026, 7:19am UTC](https://discourse.mcneel.com/t/c-userdata/214684/5 "2026-01-21T07:19:19Z")

</div>

Thank you Dale,

All working now, that was a big help!
