Click or drag to resize

GH_Document Methods

The GH_Document type exposes the following members.

Methods
  NameDescription
Public methodActiveObjects
Returns all normal objects in the document that implement the IGH_ActiveObject interface
Public methodAddObject
Add a new object to the document. If the object is already contained, nothing will happen
Public methodAlignObjects(GH_Align, GH_Distribute)
Perform alignment and distribution logic on all selected objects.
Public methodAlignObjects(GH_Align, GH_Distribute, ListIGH_DocumentObject)
Perform alignment and distribution logic on a set of objects.
Public methodAppendToDebugLog
Useful for creating textual representations of this document for debugging purposes.
Public methodArrangeObject
Rearrange the stack order of the object.
Public methodArrangeObjects
Rearrange the stack order of a collection of objects.
Public methodAssociateWithRhinoDocument
Associate this GH_Document with the currently active Rhino document. This only works if both the 3dm and the ghx file have been saved at least once.
Public methodAutoLayoutComponents
Perform automatic layout on this document.
Public methodAutoSave(GH_AutoSaveTrigger)
Creates a new autosave file on the disk. The previous autosave file (assuming it exists) will be temporarily renamed and eventually deleted entirely. Note: AutoSave is only possible on Documents that have TopLevel Rank and a valid FilePath.
Public methodAutoSave(GH_AutoSaveTrigger, Guid)
Creates a new autosave file on the disk. The previous autosave file (assuming it exists) will be temporarily renamed and eventually deleted entirely. Note: AutoSave is only possible on Documents that have TopLevel Rank and a valid FilePath.
Public methodStatic memberAutoSaveFileName
Computes the autosave filename for a full grasshopper filepath.
Public methodBoundingBox
Returns the boundingbox of all the normal attributes. If the document contains no normal attributes an Empty RectangleF structure is returned.
Public methodBringSelectionToTop
Move the selection set to the top of the visible stack
Public methodClearIgnoreList
Clears the Object Exception Ignore List.
Public methodClearReferenceTable
Destroys the Referenced object table in the Rhino event watcher. You must call this function if you either add or remove a reference to a Rhino object.
Public methodCloseAllSubsidiaries
Iterate over all subsidiary documents and close them all without saving.
Public methodClusterInputHooks
Gets a sorted list of all the cluster input hooks.
Public methodClusterInstanceCount
Counts the number of instances of a specific cluster document ID.
Public methodClusterOutputHooks
Gets a sorted list of all the cluster output hooks.
Public methodCompareTo
Compare two documents. This function does not compare document content.
Public methodConstructDocumentTree
Create a hierarchical document tree of ownership with this document as the root.
Public methodContainsClusterHooks
Tests whether this document contains at least one cluster hook.
Public methodConvertFullNamesToNickNames
Convert all nicknames to original nicknames if they are equal to the default full name. There will be no undo record associated with this operation.
Public methodConvertNickNamesToFullNames
Convert all nicknames to full names, if they are equal to the default nickname. There will be no undo record associated with this operation.
Public methodCreateAutomaticClusterHooks
Add an input hook for every non-optional input parameter with no persistent data and no sources. Then add an output hook for every floating parameter without recipients, and for every first component output parameter where the parent component has no recipients.
Public methodCreateConnectivityDiagram
Gets the connectivity diagram for the current state of this document.
Public methodCreateExpressionParser
Create a new Expression Solver preloaded with the constants defined in this document.
Public methodDefineConstant
Add a new constant to the document. Constants are not case-sensitive, when you define a constant with an existing name, the old one will be replaced. Note: constants are as of yet unused. Eventually they are supposed to become accessible to all expressions running inside a document.
Public methodDeselectAll
Deselect all top-level attributes.
Public methodDestroyAttributeCache
Destroys the Attribute cache. Call this function whenever you do something which might affect attributes.
Public methodDestroyAutoSaveFiles
Destroys all autosave files and backup files that are associated with this document. Only call this function when you are certain that the document has been properly saved and no changes have occured since.
Public methodDestroyObjectTable
Erase the Object fast lookup table. You must call this whenever you add or remove objects to or from the document while circumventing the regular channels.
Public methodDestroyPreviewCaches
Wipe all caches for Viewport Preview logic.
Public methodDestroyPreviewMeshes
Attempts to destroy all the preview meshes in this document. It might not work for all objects, but this is still your best bet.
Public methodDestroyProxySources
Remove all remaining proxy sources from the document.
Public methodDisabledObjects
Returns all disabled objects in the document
Public methodDispose
When you discard documents you must call Dispose or the Viewport Display event handlers will not be disconnected.
Public methodStatic memberDuplicateDocument
Attempt to duplicate a document.
Public methodEnabledObjects
Returns all enabled objects in the document
Public methodExpandSelection
Grow or shift the selection set based on source and recipient links
Public methodExpirePreview
Expires the preview caches of the conduit.
Public methodExpireSolution
Expire the entire solution. This will blank all objects.
Public methodStatic memberFilterActive
Filter a list of objects.
Public methodStatic memberFilterDisabled
Filter a list of objects.
Public methodStatic memberFilterEnabled
Filter a list of objects.
Public methodStatic memberFilterInactive
Filter a list of objects.
Public methodFilterObjects(GH_Filter, GH_Filter, GH_Filter)
Returns all objects in the document that pass the filter specification
Public methodStatic memberFilterObjects(ListIGH_DocumentObject, GH_Filter, GH_Filter, GH_Filter)
Filter a list of objects using several filters at once
Public methodStatic memberFilterSelected
Filter a list of objects.
Public methodStatic memberFilterUnselected
Filter a list of objects.
Public methodFindAllDownstreamObjects(IGH_ActiveObject)
Find all objects that depend in some way on the Source.
Public methodFindAllDownstreamObjects(ListIGH_ActiveObject)
Find all objects that depend in some way on the Source collection
Public methodFindAllDownstreamObjects(IGH_ActiveObject, GH_DocumentGH_ActiveObjectFilter)
Find all objects that depend in some way on the Source.
Public methodFindAllDownstreamObjects(ListIGH_ActiveObject, GH_DocumentGH_ActiveObjectFilter)
Find all objects that depend in some way on the Source collection
Public methodFindAttribute(Guid)
Find the object that matches the ID
Public methodFindAttribute(PointF, Boolean)
Search for attributes that contain a certain point.
Public methodFindAttributeByGrip(PointF, Boolean, Int32)
Search for attributes that contain grips near the search locus
Public methodFindAttributeByGrip(PointF, Boolean, Boolean, Boolean, Int32)
Search for attributes that contain grips near the search locus
Public methodFindClusters(Guid)
Find all the clusters that have a matching ID.
Public methodFindClusters(String)
Find all the clusters that have a matching filepath.
Public methodFindComponent(Guid)
Search for components using an ID filter
Public methodFindComponent(Point)
Search for components that contain the locus
Public methodFindFloatingParameter
Search for floating parameters that contain the locus
Public methodFindInputParameter
Search for input (upstream) parameters that contain the locus
Public methodFindObject(Guid, Boolean)
Find the object that matches the ID.
Public methodFindObject(PointF, Single)
Find the topmost object that is closest to the point
Public methodFindObjectT(Guid, Boolean)
Find the object that matches the ID.
Public methodFindObjects
Find the objects in the document that match the search term. Top level object names and nicknames are searched, as well as descriptions. Some objects are special cased to allow for more targeted searches. Data descriptions are not searched.
Public methodFindOutputParameter
Search for output (downstream) parameters that contain the locus
Public methodFindParameter
Search for parameters using an ID filter
Public methodFindWireAt
Find the wire at or near the given coordinate.
Public methodForcePreview
If true, the document will draw viewport previews regardless of other conditions. Typically a document only previews if it is loaded in the canvas or when it has an RCP.
Public methodGetAllInstanceIDs
Get a sorted list of all the IGH_DocumentObject instance IDs in this document.
Public methodInactiveObjects
Returns all objects in the document that don't implement the IGH_ActiveObject interface
Public methodInvertSelection
Invert the selected state of all top-level attributes.
Public methodStatic memberIsEscapeKeyDown
Gets whether the escape key was pressed since the last time this function was called. Though in reality the actual escape state is checked no more than once every 50 milliseconds or so, which should be sufficient for a smooth user experience.
Public methodIsRenderMeshPipelineViewport
Test to see whether a pipeline should have custom render meshes vs. previews.
Public methodMergeDocument(GH_Document)
Hoist all objects from another document into this one.
Public methodMergeDocument(GH_Document, Boolean)
Hoist all objects from another document into this one.
Public methodMergeDocument(GH_Document, Boolean, Boolean)
Hoist all objects from another document into this one.
Public methodModified
Sets the modified flag of this document.
Public methodMutateAllIds
Change all the instance UUIDs of all objects in the document. Be sure to resolve all proxy sources before mutating IDs. This function will ensure all groups are updated appropriately.
Public methodNewSolution(Boolean)
Start a new solution.
Public methodNewSolution(Boolean, GH_SolutionMode)
Start a new solution.
Public methodStatic memberNonBlankFilter
This delegate can be used in the FindAllDownstreamObjects(...) methods. Only includes objects that are non-blank and non-failed.
Public methodStatic memberNullFilter
This delegate can be used in the FindAllDownstreamObjects(...) methods. Includes all objects.
Public methodOnContextChanged
Raise the ContextChanged event.
Public methodOnEnabledChanged
Raise the EnabledChanged event.
Public methodOnFilePathChanged
Raise the FilePathChanged event.
Public methodOnModifiedChanged
Raise the ModifiedChanged event
Public methodOnObjectAdded
Raise the ObjectsAdded event.
Public methodOnObjectDeleted
Raise the ObjectsDeleted event.
Public methodOnObjectsAdded
Raise the ObjectsAdded event.
Public methodOnObjectsDeleted
Raise the ObjectsDeleted event.
Public methodOnSettingsChanged
Raise the SettingsChanged event.
Public methodOnUndoStateChanged
Raise the UndoStateChanged event.
Public methodPreviewCurrentMeshParameters
Gets the currently relevant meshing parameters (do not modify the instance as it may be shared).
Public methodRead
Standard archiving function. Will deserialize the entire document.
Public methodRedo
Perform the first redo event.
Public methodRelevantObjectAtPoint(PointF)
Find the most relevant object at a given canvas location. The most relevant object might be a regular Object (Component or Parameter), it might be an attribute grip, an attribute balloon, a wire or a group.
Public methodRelevantObjectAtPoint(PointF, GH_RelevantObjectFilter)
Find the most relevant object at a given canvas location. The most relevant object might be a regular Object (Component or Parameter), it might be an attribute grip, an attribute balloon, a wire or a group.
Public methodRemoveObject(IGH_Attributes, Boolean)
Remove the top-level object in the attribute tree from the document. This method does not add an Undo event, that is the responsibility of the caller.
Public methodRemoveObject(IGH_DocumentObject, Boolean)
Remove the object from the document. This removal is the precursor to object deletion. Do not call this function if you intend to transfer the object to another GH_Document. This method does not add an Undo event, that is the responsibility of the caller.
Public methodRemoveObjects
Remove the specified objects from the document. This removal is the precursor to object deletion. Do not call this function if you intend to transfer the objects to another GH_Document. This method does not add an Undo event, that is the responsibility of the caller.
Public methodRemoveSelection
Delete all the objects in the selection set. This method does not record an Undo event, that is the responsibility of the caller.
Public methodRepairProxySources
Attempts to resolve all proxy sources in the document.
Public methodReplaceProxySources
Replace all remaining proxy sources in the document with UnresolvedProxy Objects.
Public methodRequestAbortSolution
Set the requestabort flag. The solution will be aborted whenever the current active object is completed. It is also possible that active objects themselves implement an abortion mechanism, in which case abortion might occur even sooner.
Public methodRunningAsCommand
When the document is being solved inside the context of an executing Rhino command, this function will return the command instance. Under normal operation of Grasshopper in the traditional sense, this function will return null. The document executes as a command when inside of the grasshopper player or as a compiled grasshopper player based command. The way to run a GH_Document as a command is to call the GH_RhinoScriptInterface.RunAsCommand function
Public methodScheduleSolution(Int32)
Schedule a new solution after a specified time interval. The schedule is erased if another solution is triggered before the schedule is executed. Tight schedules override loose schedules. If this method is called during a solution, the schedule will be started after the current solution completes.
Public methodScheduleSolution(Int32, GH_DocumentGH_ScheduleDelegate)
Schedule a new solution after a specified time interval. The schedule is erased if another solution is triggered before the schedule is executed. Tight schedules override loose schedules. If this method is called during a solution, the schedule will be started after the current solution completes.
Public methodSelect(GH_RelevantObjectData)
Default pick selection behaviour. (looks at current Shift + Control modifier states to determine addition/removal)
Public methodSelect(GH_RelevantObjectData, Boolean, Boolean)
Default pick selection behaviour
Public methodSelectAll
Select all top-level attributes.
Public methodSelectedObjects
Returns all selected objects in the document
Public methodSetEnabledFlags(Boolean)
Set the enabled flags of all selected objects to true or false
Public methodSetEnabledFlags(ListIGH_DocumentObject, Boolean)
Set the enabled flags of all specified objects to true or false
Public methodSetPreviewFlags(Boolean)
Set the preview flags of all selected objects to true or false
Public methodSetPreviewFlags(ListIGH_DocumentObject, Boolean)
Set the preview flags of all specified objects to true or false
Public methodSetStatusBarEventHelper
Public methodShowPreviewSettings
Display the Preview settings dialog.
Public methodSolutionProgress
Returns the progress of the current solution.
Public methodToggleEnabledFlags
Toggle the enabled flags of all selected objects
Public methodToggleEnabledFlags(ListIGH_DocumentObject)
Toggle the enabled flags of all specified objects
Public methodTogglePreviewFlags
Toggle the preview flags of all selected objects
Public methodTogglePreviewFlags(ListIGH_DocumentObject)
Toggle the preview flags of all specified objects
Public methodToString
A document serializes itself using the filename of the current path. This is useful for sorting purposes and ListBoxes.
(Overrides ObjectToString.)
Public methodTranslateObjects
Offset objects by a certain distance in X and Y
Public methodUndo
Perform the first undo event.
Public methodUnselectedObjects
Returns all unselected objects in the document
Public methodUpdateAllSubsidiaries
Iterate over all subsidiary documents and update them with their respective owners. If a subsidiary hasn't been modified, it will not be updated and it will not be counted.
Public methodWrite(GH_IWriter)
Standard archiving function. Will serialize the entire document.
Public methodWrite(GH_IWriter, IListIGH_DocumentObject)
Special function that allows writing of a custom object list. This function is used when partial documents need to be serialized such as when exporting or during clipboard operations.
Top
See Also