# UserData class

Namespace: [Rhino.DocObjects.Custom](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.docobjects.custom.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
public abstract class UserData : IDisposable
```

Provides a base class for custom classes of information which may be attached to geometry or attribute classes.

**Derived types:** [UnknownUserData](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.unknownuserdata.md), [UserDictionary](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdictionary.md)

## Finalizer

- [~UserData](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/finalize.md): Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().

## Properties

- [Description](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/description.md): Descriptive name of the user data.
- [ShouldWrite](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/shouldwrite.md): If you want to save this user data in a 3dm file, override ShouldWrite and return true. If you do support serialization, you must also override the Read and Write functions.
- [Transform](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/transform.md): Updated if user data is attached to a piece of geometry that is transformed and the virtual OnTransform() is not overridden. If you override OnTransform() and want Transform to be updated, then call the base class OnTransform() in your override. The default constructor sets Transform to the identity.

## Methods

- [Copy](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/copy.md): (static) Expert user tool that copies user data that has a positive CopyCount from the source object to a destination object. Generally speaking you don't need to use Copy(). Simply rely on things like the copy constructors to do the right thing.
- [Dispose](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/dispose.md): (2 overloads) Actively reclaims unmanaged resources that this instance uses.
- [MoveUserDataFrom](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/moveuserdatafrom.md): (static) Moves the user data from objectWithUserData to a temporary data storage identified by the return Guid. When MoveUserDataFrom returns, the objectWithUserData will not have any user data.
- [MoveUserDataTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/moveuserdatato.md): (static) Moves the user data. See [UserData.MoveUserDataFrom(CommonObject)](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/moveuserdatafrom.md) for more information.
- [OnDuplicate](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/onduplicate.md): Is called when the object is being duplicated.
- [OnTransform](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/ontransform.md): Is called when the object associated with this data is transformed. If you override this function, make sure to call the base class if you want the stored Transform to be updated.
- [Read](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/read.md): Reads the content of this data from a stream archive.
- [Write](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.custom.userdata/write.md): Writes the content of this data to a stream archive.
