# DocumentIO 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 sealed class DocumentIO
```

Utility methods for saving and opening documents.

## Constructors

- [DocumentIO](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/ctor.md): Create a new empty IO class. Use this constructor if you wish to Open/Load a file.

## Fields

- [ClipboardDocumentType](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/clipboarddocumenttype.md): (static)
- [G1BinaryExtension](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/g1binaryextension.md): (static) Gets the extension (including the period) for Grasshopper 1.0 binary files.
- [G1DataExtension](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/g1dataextension.md): (static) Gets the extension (including the period) for Grasshopper 1.0 data files.
- [G1XmlExtension](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/g1xmlextension.md): (static) Gets the extension (including the period) for Grasshopper 1.0 Xml files.
- [G2AutoSaveExtension](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/g2autosaveextension.md): (static) Gets the extension (including the period) for Grasshopper 2.0+ autosave files.
- [G2BackupExtension](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/g2backupextension.md): (static) Gets the extension (including the period) for Grasshopper 2.0+ backup files.
- [G2SmlExtension](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/g2smlextension.md): (static) Gets the extension (including the period) for Sml files.
- [G2ZipExtension](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/g2zipextension.md): (static) Gets the extension (including the period) for Grasshopper 2.0+ files.

## Properties

- [Compression](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/compression.md): Gets or sets the compression level used when writing GHZ files.
- [Document](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/document.md): Gets the document currently associated with this IO utility.
- [DocumentRoot](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/documentroot.md): When a document is saved or loaded, and RetainRoot is true, the archive root node is stored here.
- [ReportErrors](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/reporterrors.md): Gets or sets whether exceptions are displayed in an Error feedback window.
- [ResolvePlugins](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/resolveplugins.md): Gets whether opening a file offers the user a way to fetch plugins it needs but does not have. Deliberately separate from [DocumentIO.ReportErrors](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/reporterrors.md). That one governs whether a failure is shown in an error window; this one governs whether the user is asked a question. Session restore wants the second without the first — it reopens the user's own files and should certainly offer to fetch what they need, while a per-file error box at startup would be a menace.
- [RetainRoot](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/retainroot.md): Retain the root of the archive used to open a document.
- [RootFolder](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/rootfolder.md): Gets or sets the root folder for Save/Open dialogs to revert to in case the file itself doesn't have a directory yet.
- [TrackFiles](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/trackfiles.md): Gets or sets whether save and open operations on this instance add recent file records.
- [Window](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/window.md): Gets or sets the window which functions as the parent of any Save or Open dialogs. If left unset, the Grasshopper2.UI.Editor.Instance will be used.

## Methods

- [Copy](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/copy.md): Copy the selected objects of the loaded document into the specified clipboard.
- [Examine](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/examine.md): (2 overloads) Ask the user to pick a file and then examine that file in a custom browser.
- [Export](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/export.md): (2 overloads) Export the loaded document to an SML file.
- [FindScribbleTexts](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/findscribbletexts.md): (static) Try and harvest all scribble texts from a document file. This method will read the file, but it will not construct a new [Document](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.document.md) instance.
- [Open](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/open.md): (2 overloads) Display the open file dialog and load the selected document.
- [Paste](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/paste.md): Paste the data in the specified clipboard into the document inside this instance.
- [Save](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/save.md): (2 overloads) Execute the regular 'Save' operation on the loaded document. This will either override the current file if the document is already associated with a URI, or it will open the SAVE FILE dialog.
- [SaveAs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/saveas.md): Execute the regular 'Save As' operation on the loaded document. This will always show the SAVE FILE dialog, possibly anchored to the current document URI.
- [SaveCopy](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/savecopy.md): (2 overloads) Execute the regular 'Save A Copy' operation on the loaded document. This will always show the SAVE FILE dialog, possibly anchored to the current document URI, but it will not override the document URI path.
- [SaveSnippet](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/savesnippet.md): Save the document to the central Snippets folder.
- [ShowExportDialog](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/showexportdialog.md): Show the Export to Sml dialog and return the selected path.
- [ShowOpenDialog](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/showopendialog.md): (static)
- [ShowSaveDialog](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/showsavedialog.md): Show the Save dialog and return the selected path.
- [TryHarvestCanvasThumbnail](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/tryharvestcanvasthumbnail.md): (static) Try and get the canvas thumbnail image stored inside a GHZ file.
- [TryHarvestViewportThumbnail](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.documentio/tryharvestviewportthumbnail.md): (static) Try and get the viewport thumbnail image stored inside a GHZ file.
