Constructors
GH_DocumentIO
#public GH_DocumentIO()
Create a new instance of GH_DocumentIO without an internal document.
GH_DocumentIO
#Create a new instance of GH_DocumentIO with an internal document.
Parameters:
| internal_doc (GH_Document) | Document to internalise. |
Properties
Methods
ClearClipboard
#Clear the Clipboard Text content. This function wipes both the Text and UnicodeText clipboard fields.
Parameters:
| clipboard (GH_ClipboardType) |
Copy
#Copy the internal document into the clipboard.
Parameters:
| clipboard (GH_ClipboardType) | Specifies the clipboard type to use. |
| limitToSelection (bool) | If true, only the selected objects will be copied. |
Returns: True on success, false on failure.
Copy
#Copy the specified objects in the internal document into the clipboard.
Parameters:
| clipboard (GH_ClipboardType) | Specifies the clipboard type to use. |
| guids (IEnumerable<Guid>) | List of object ids to copy. |
Returns: True on success, false on failure.
Copy
#Copy the internal document into the clipboard.
Parameters:
| clipboard (GH_ClipboardType) | Specifies the clipboard type to use. |
GetDocumentIcon
#Try and extract the icon image of a document. Not all gh/ghx files contain an icon so this function may return null. The document itself is not loaded and rendered, so the icon really has to be part of the file already.
GetDocumentThumbnail
#Try and extract the preview image of a document. Not all gh/ghx files contain a thumbnail so this function may return null. The document itself is not loaded and rendered, so the thumbnail really has to be part of the file already.
Parameters:
| filePath (string) | Filepath to examine. |
Returns: A preview bitmap on success or null on failure. Caller is responsible for disposing of the image.
Open
#Perform a default Open operation and store the result as the internal document.
Returns: True on success, false on failure.
Open
#Open the file at the given location.
Parameters:
| filePath (string) | Path of Grasshopper file to open. |
Returns: True on success, false on failure.
OpenDocumentDialog
#Display the Open GH/GHX dialog.
Paste
#Deserialize a Grasshopper document from the clipboard. On success, the internal document of this GH_DocumentIO instance will be set.
Parameters:
| clipboard (GH_ClipboardType) | Specifies the clipboard type to use. |
Returns: True on success, false on failure.
Save
#Perform a default Save operation on the internal document.
Returns: True on success, false on failure.
SaveAs
#Perform a default Save As operation on the internal document.
Returns: True on success, false on failure.
SaveAsCopyDocumentDialog
#Display the Save As Copy GH/GHX dialog.
Parameters:
| path (string = null) | Optional default path. |
Returns: FileName specified via the Save As Copy dialog or null if the dialog was cancelled.
SaveAsDocumentDialog
#Display the Save As GH/GHX dialog.
Parameters:
| path (string = null) | Optional default path. |
Returns: FileName specified via the Save As dialog or null if the dialog was cancelled.
SaveDocumentDialog
#Display the Save GH/GHX dialog.
SaveQuiet
#Quietly save a file to a given location.
Parameters:
| path (string) |
Returns: True on success, false on failure.
ShowOverwriteDialog
#SubsidiaryDocumentSavePrompt
#Display a 'stuff has changed do you want to save' message box with Yes/No/Cancel options.
Parameters:
| document (GH_Document) | Top level document. |
Returns: Yes, No, Cancel or None state.
SubsidiaryDocumentSavePrompt
#public static DialogResult SubsidiaryDocumentSavePrompt(string documentName, bool modified, int modifiedSubsidiaries)
Display a 'stuff has changed do you want to save' message box with Yes/No/Cancel options.