# DocumentMethods class

Namespace: [Grasshopper2.Doc](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.doc.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public class DocumentMethods
```

This class exposes common operations that are performed on documents. Always consider using a method in this class instead of a more low-level one.

## Methods

- [AddDependency](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/adddependency.md): (2 overloads) Add a listen object with a specific dependency to this document at the given location.
- [CanCreateChain](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/cancreatechain.md): Gets whether the specified objects can be turned into a chain.
- [CanCreateCluster](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/cancreatecluster.md): Gets whether the specified objects can be turned into a cluster.
- [ChainObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/chainobjects.md): Attempt to chain a set of objects. Only consecutively selected components which are connected only to their neighbours can be chained.
- [ChainSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/chainselection.md): Attempt to chain the current selection. Only consecutively selected components which are connected only to their neighbours can be chained.
- [ClusterObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/clusterobjects.md)
- [ClusterSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/clusterselection.md): Move all selected objects into a cluster. A cluster operation requires that the selection topology is either singleton or convex. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [CopySelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/copyselection.md): Perform a copy to clipboard operation on the selected objects.
- [CutSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/cutselection.md): Perform a cut to clipboard operation on the selected objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [DeleteObjectData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/deleteobjectdata.md): Delete all persistent data in all specified objects.
- [DeleteObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/deleteobjects.md): Delete all specified objects. Note that deletion completely isolates objects from their neighbours. As such, the objects are not really fit to be inserted into a different document afterwards.
- [DeleteSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/deleteselection.md): Delete all selected objects and wires.
- [DeleteSelectionData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/deleteselectiondata.md): Delete all persiustent data in all selected objects.
- [DeselectAll](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/deselectall.md): Deselect all objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [DisableObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/disableobjects.md): Disables all specified objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [DisableSelected](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/disableselected.md): Disables all objects in the current selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [DropObject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/dropobject.md): (4 overloads) Add an undoable object at the specified location.
- [DropSnippet](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/dropsnippet.md): Add an undoable snippet at a specific location.
- [EnableObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/enableobjects.md): Enables all specified objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [EnableSelected](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/enableselected.md): Enables all objects in the current selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [GroupObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/groupobjects.md): Put all supplied objects into a group.
- [GroupSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/groupselection.md): Put all selected objects into a named group. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [GrowSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/growselection.md): Grow the selection one level to the left and/or right. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [HideObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/hideobjects.md): Disables the display of all specified objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [HideSelected](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/hideselected.md): Disables the display of all objects in the current selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [HideSelectedInputs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/hideselectedinputs.md): Disables the display of all input parameters in the current selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [HideSelectedOutputs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/hideselectedoutputs.md): Disables the display of all output parameters in the current selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [InvertSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/invertselection.md): Invert the selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [IsolateObject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/isolateobject.md): (2 overloads) Isolate an object. Note that this method modifies the document state without adding any undo record. If you wish to isolate objects in an undo-able fashion, you should use the [Document.Methods](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.document/methods.md) class instead.
- [MakeRoom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/makeroom.md): Make room in the document by inflating a rectangle from the `` to the `` dimensions and moving nearby objects away to avoid overlaps. Each displaced object retains, at most, the spacing it had to its (original) neighbour before the expansion; this is capped at the horizontal/vertical alignment gap from [SnappingSettings.Current](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.canvas.snappingsettings/current.md). Objects strictly to the left of `before` are never moved.
- [MigrateObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/migrateobjects.md): Add a list of objects (possibly from another document) to this document. The objects will be removed from the other document without any undo records. InstanceIDs will be changed if they conflict with objects already in this document.
- [MoveSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/moveselection.md): Move all selected objects.
- [PasteFromClipboard](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/pastefromclipboard.md): Perform a paste from clipboard operation. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [PasteGrasshopper1XmlFromClipboard](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/pastegrasshopper1xmlfromclipboard.md): Try and paste the Grasshopper 1.0 xml archive on the OS clipboard into the document. Objects with dedicated migrators are converted, components without one become interop components, and the wires among the pasted objects are preserved.
- [RestorePlaceholders](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/restoreplaceholders.md): Replace every placeholder in this document whose original object can now be deserialised, typically because a missing plugin was just installed. This includes the placeholders inside clusters hosted by this document, at any nesting depth. Placeholders which still fail to deserialise are left alone; they lose nothing and may succeed on a later attempt. Instance ids are stable across each swap, so the wires of surviving neighbours need no repair.
- [SelectAll](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/selectall.md): Select all objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [SetColourOverrideObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/setcolouroverrideobjects.md): Set the display colour override from all specified objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [SetColourOverrideSelected](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/setcolouroverrideselected.md): Set the display colour override on all selected objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [ShiftSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/shiftselection.md): Shift the selection one level to the left or right. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [ShowDependencyGraph](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/showdependencygraph.md): Show the dependency graph leading up to this document in a modal dialog. If this document has no dependencies this method returns immediately.
- [ShowObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/showobjects.md): Enables the display of all specified objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [ShowSelected](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/showselected.md): Enables the display of all objects in the current selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [ShowSelectedInputs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/showselectedinputs.md): Enables the display of all input parameters in the current selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [ShowSelectedOutputs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/showselectedoutputs.md): Enables the display of all output parameters in the current selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [SplitWire](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/splitwire.md): Insert a Shout+Listen pair into an existing wire.
- [ToggleDisplayObjects](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/toggledisplayobjects.md): Toggle the display of all specified objects. Note that this method does not cause a new solution, nor any viewport or canvas updates.
- [ToggleDisplaySelected](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentmethods/toggledisplayselected.md): Toggle the display of all objects in the current selection. Note that this method does not cause a new solution, nor any viewport or canvas updates.
