# IGH_DocumentObject interface

Namespace: [Grasshopper.Kernel](https://developer.rhino3d.com/api/gh1/namespace/grasshopper.kernel.md) · Assembly: [Grasshopper](https://developer.rhino3d.com/api/gh1/assembly/grasshopper.md)

```cs
public interface IGH_DocumentObject : IGH_InstanceDescription
```

Base interface for objects that want to play on the Canvas. Do not implement this interface from scratch. Either inherit from GH_DocumentObject or one of the other partially finished types such as GH_ActiveObject, GH_Param(Of T) or GH_Component.

**Derived types:** [GH_DocumentObject](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject.md), [IGH_ActiveObject](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-activeobject.md)

## Properties

- [Attributes](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/attributes.md): Gets or sets the attributes that are associated with this object. Only set custom attributes if you know what you are doing.
- [ComponentGuid](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/componentguid.md): Returns a consistent ID for this object type. Every object must supply a unique and unchanging ID that is used to identify objects of the same type.
- [Exposure](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/exposure.md): Gets the exposure of this object in the Graphical User Interface.
- [Icon_24x24](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/icon-24x24.md): The icon associated with this object.
- [Icon_24x24_Locked](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/icon-24x24-locked.md): The greyscale icon of this object.
- [IconDisplayMode](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/icondisplaymode.md): Gets the current display mode of the object.
- [Obsolete](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/obsolete.md): Gets whether this object is Obsolete.

## Methods

- [AddedToDocument](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/addedtodocument.md): This method will be called when an object is added to a document.
- [AppendMenuItems](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/appendmenuitems.md): This function is called when a context menu is about to be displayed. Override it to set custom items.
- [CreateAttributes](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/createattributes.md): Create new default attributes for this object. You should only call this function when the Attributes() field is null.
- [DocumentContextChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/documentcontextchanged.md): This method will be called when the document that owns this object moves into a different context.
- [ExpirePreview](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/expirepreview.md): Call this function when you suspect that the preview has expired for this object. This will cause the display cache to be eradicated.
- [ExpireSolution](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/expiresolution.md): Call this function whenever you do something which expires the current solution. This will make sure all caches are erased, all downstream objects are expired and that the event is raised. The default implementation merely places a call to OnSolutionExpired(), override this function in derived classes to make sure you clear local data caches and expire downstream objects.
- [IsolateObject](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/isolateobject.md): Destroy all connections to other objects.
- [MovedBetweenDocuments](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/movedbetweendocuments.md): This method will be called when an object is moved from one document to another.
- [OnAttributesChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/onattributeschanged.md): Raises the AttributesChanged event on the toplevel object.
- [OnDisplayExpired](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/ondisplayexpired.md): Raises the DisplayExpired event on the toplevel object.
- [OnObjectChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/onobjectchanged.md): (5 overloads) Raises the ObjectChanged event on the current (!not the top level!) object.
- [OnPingDocument](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/onpingdocument.md): Raise the PingDocument Event on the toplevel object and try to find the document which owns this object.
- [OnPreviewExpired](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/onpreviewexpired.md): Raises the PreviewExpired event on the toplevel object.
- [OnSolutionExpired](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/onsolutionexpired.md): Raises the SolutionExpired event on the toplevel object.
- [RecordUndoEvent](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/recordundoevent.md): (3 overloads) Record a specific object change undo event.
- [RemovedFromDocument](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/removedfromdocument.md): This method will be called when an object is removed from a document.
- [TriggerAutoSave](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/triggerautosave.md): (4 overloads) Triggers the AutoSave function on the owner document with the object_changed flag.

## Events

- [AttributesChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/attributeschanged.md): Raised whenever the number or kind of attributes changes. This event is handled by GH_Documents who subsequently wipe their attribute caches.
- [DisplayExpired](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/displayexpired.md): Raised whenever the display (on the Canvas) of a certain object becomes invalid.
- [ObjectChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/objectchanged.md): Raised whenever some property of the object changes that would affect remote instances.
- [PingDocument](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/pingdocument.md): Raised whenever an object needs to know which GH_Document it belongs to.
- [PreviewExpired](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/previewexpired.md): Raised whenever the display (in the Rhino viewports) of a certain object becomes invalid.
- [SolutionExpired](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-documentobject/solutionexpired.md): Raised whenever the solution of a certain object becomes invalid.

## Inherited Members

- From [IGH_InstanceDescription](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription.md): [Category](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/category.md), [Description](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/description.md), [HasCategory](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/hascategory.md), [HasSubCategory](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/hassubcategory.md), [InstanceDescription](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/instancedescription.md), [InstanceGuid](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/instanceguid.md), [Keywords](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/keywords.md), [Name](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/name.md), [NickName](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/nickname.md), [SubCategory](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/subcategory.md), [NewInstanceGuid](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.igh-instancedescription/newinstanceguid.md)
- From [GH_ISerializable](https://developer.rhino3d.com/api/gh1/type/gh-io.gh-iserializable.md): [Read](https://developer.rhino3d.com/api/gh1/type/gh-io.gh-iserializable/read.md), [Write](https://developer.rhino3d.com/api/gh1/type/gh-io.gh-iserializable/write.md)
