# GH_DocumentObject class

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 abstract class GH_DocumentObject : GH_InstanceDescription, IGH_DocumentObject
```

Standard implementation of IGH_DocumentObject.

**Derived types:** [GH_ActiveObject](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-activeobject.md), [GH_Group](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.special.gh-group.md), [GH_JumpObject](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.special.gh-jumpobject.md), [GH_Markup](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.special.gh-markup.md), [GH_Scribble](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.special.gh-scribble.md), [GH_TextBalloon](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.special.gh-textballoon.md)

## Constructors

- [GH_DocumentObject](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/ctor.md): (3 overloads)

## Fields

- [m_attributes](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/m-attributes.md)

## Properties

- [Attributes](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-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.gh-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.gh-documentobject/exposure.md): Gets the exposure of this object in the Graphical User Interface. The default is to expose everywhere.
- [Icon](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/icon.md): Override this function to supply a custom icon (24x24 pixels). The result of this property is cached, so don't worry if icon retrieval is not very fast.
- [Icon_24x24](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/icon-24x24.md): The icon associated with this object.
- [Icon_24x24_Locked](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/icon-24x24-locked.md): The greyscale icon of this object.
- [IconDisplayMode](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/icondisplaymode.md): Gets the current display mode of the object.
- [Internal_Icon_24x24](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/internal-icon-24x24.md): Override this function to supply a custom icon. The result of this property is cached, so don't worry if icon retrieval is not very fast.
- [Obsolete](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/obsolete.md): Gets whether this object is obsolete. Default implementation returns true if the class name contains the string "OBSOLETE" or if this class has been decorated with the ObsoleteAttribute. You are free to override this if you want, but I suggest adding the ObsoleteAttribute instead.

## Methods

- [AddedToDocument](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/addedtodocument.md): This method will be called when an object is added to a document. Override this method if you want to handle such events.
- [AppendMenuItems](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/appendmenuitems.md): This function is called when a context menu is about to be displayed. Override it to set custom items.
- [ConnectNewObject](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/connectnewobject.md): (static)
- [CreateAttributes](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/createattributes.md): This function creates the stand-alone attributes for this object. If you wish to supply your own Attributes, you must override this function.
- [DestroyIconCache](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/destroyiconcache.md): Call this method to erase the existing icon cache. You must call this if you want to change the display icon of an object.
- [DocumentContextChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-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.gh-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.gh-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.
- [GetValue](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/getvalue.md): (5 overloads) Get a boolean value from the component value table.
- [HtmlHelp_Source](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/htmlhelp-source.md): Return a String which contains HTML formatted source for the help topic. If you want to pass a URL that points to a remote page, then prefix the URL with a GOTO: tag, like so: GOTO:http://www.YourWebAddressHere.com
- [IsolateObject](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/isolateobject.md): Destroy all connections to other objects.
- [Menu_AppendColourPicker](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appendcolourpicker.md): (static) Add a colour picker to a menu.
- [Menu_AppendCustomItem](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appendcustomitem.md): (3 overloads, static) Utility function for inserting exotic controls into dropdown menus.
- [Menu_AppendDigitScrollerItem](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appenddigitscrolleritem.md): (static) Utility function for inserting a digit scroller into menus.
- [Menu_AppendGenericMenuItem](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appendgenericmenuitem.md): (static, obsolete) This method is obsolete.
- [Menu_AppendItem](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appenditem.md): (7 overloads, static) Utility function for appending generic menu items.
- [Menu_AppendObjectHelp](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appendobjecthelp.md): Appends the default object Help menu item.
- [Menu_AppendObjectName](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appendobjectname.md): Appends the old-fashioned object name menu item. If you also want the Display mode toggle then use Menu_AppendObjectNameEx()
- [Menu_AppendObjectNameEx](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appendobjectnameex.md): Appends the default object name + display mode menu item.
- [Menu_AppendPublish](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appendpublish.md): Appends the default item for publishing to RCP. This menu will only appear if the current class implement IRcpAwareObject
- [Menu_AppendSeparator](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appendseparator.md): (static) Utility function for appending separators to a menu dropdown. If the dropdown is empty or if it already has a separator at the bottom, nothing will happen.
- [Menu_AppendTextItem](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-appendtextitem.md): (2 overloads, static) Utility function for inserting text boxes into menus.
- [Menu_MoveItem](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/menu-moveitem.md): (2 overloads, static) Utility function for moving menu items.
- [MovedBetweenDocuments](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/movedbetweendocuments.md): This method will be called when an object is moved from one document to another. Override this method if you want to handle such events.
- [OnAttributesChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/onattributeschanged.md): Raises the AttributesChanged event on the toplevel object.
- [OnDisplayExpired](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/ondisplayexpired.md): Raises the DisplayExpired event on the toplevel object.
- [OnObjectChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/onobjectchanged.md): (5 overloads)
- [OnPingDocument](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-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.gh-documentobject/onpreviewexpired.md): Raises the PreviewExpired event on the toplevel object.
- [OnSolutionExpired](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/onsolutionexpired.md): Raises the SolutionExpired event on the toplevel object. You probably want to call ExpireSolution() instead of this method directly.
- [Read](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/read.md)
- [RecordUndoEvent](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/recordundoevent.md): (3 overloads) Record a specific object change undo event.
- [RemovedFromDocument](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/removedfromdocument.md): This method will be called when an object is removed from a document. Override this method if you want to handle such events.
- [SetIconOverride](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/seticonoverride.md): Set a new custom icon override for this object.
- [SetValue](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/setvalue.md): (5 overloads) Set a named value. This value will be serialized with the component.
- [TriggerAutoSave](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/triggerautosave.md): (4 overloads) Triggers the AutoSave function on the owner document with the object_changed flag.
- [ValuesChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/valueschanged.md): Override this method if you want to respond to changes to the value table. The base implementation is empty, so you don't have to call it.
- [Write](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-documentobject/write.md)

## Events

- [AttributesChanged](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-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.gh-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.gh-documentobject/objectchanged.md)
- [PingDocument](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-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.gh-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.gh-documentobject/solutionexpired.md): Raised whenever the solution of a certain object becomes invalid.

## Inherited Members

- From [GH_InstanceDescription](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription.md): [Category](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/category.md), [Description](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/description.md), [HasCategory](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/hascategory.md), [HasSubCategory](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/hassubcategory.md), [InstanceDescription](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/instancedescription.md), [InstanceGuid](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/instanceguid.md), [Keywords](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/keywords.md), [Name](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/name.md), [NickName](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/nickname.md), [SubCategory](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/subcategory.md), [CopyFrom](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/copyfrom.md), [NewInstanceGuid](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/newinstanceguid.md), [ReadFull](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/readfull.md), [WriteFull](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.gh-instancedescription/writefull.md)
