GH_Document

References
Represents a single Grasshopper document.

Constructors

GH_Document

#
Constructor for GH_Document. Makes sure all important members are initialized.
public GH_Document()

Fields

IgnoredUnknowns

#
A collection of missing component IDs to ignore during file load operations. Erase this cache to re-enable all the load warnings.
public static readonly HashSet<Guid> IgnoredUnknowns

ScheduleInactive

#
Defined the delay used to indicate the absence of a schedule.
public const int ScheduleInactive = -1

ScheduleRecursive

#
Defines the delay used to indicate the schedule should be immedate and recursive.
public const int ScheduleRecursive = 0

Properties

AbortRequested

#
Gets the AbortRequested flag state.
public bool AbortRequested { get; }

ActiveDoc

#
Gets or sets a value indicating that this document was last active in a multi-doc aware Rhino.
public bool ActiveDoc { get; set; }
true if this was the last active document; otherwise, false.

AttributeCount

#
Returns the total number of attributes in the document. Both Normal and Hidden ones
public int AttributeCount { get; }

Attributes

#
Returns a list of all the attributes in this document. This includes attributes for nested objects such as input or output parameters.
public IList<IGH_Attributes> Attributes { get; }
Remarks: If the attribute cache is empty, it will be rebuild. Hence, this could be quite an expensive call to make.

Author

#
Gets the author details associated with this document.
public IGH_Author Author { get; }

ConstantServer

#
Gets the dictionary of constants defined in this document.
public SortedDictionary<string, GH_Variant> ConstantServer { get; }

ContainsCustomPreviewObjects

#
Gets whether this document contains *any* custom preview objects.
public bool ContainsCustomPreviewObjects { get; }

ContainsCustomRenderObjects

#
Gets whether this document contains custom preview objects which are both ENABLED and included in RENDERING.
[EditorBrowsable(EditorBrowsableState.Never)] public bool ContainsCustomRenderObjects { get; }

Context

#
Gets or sets the context for this document. Note that the context is not a state so much as an action. Therefore it is not particularly useful to read the context after the fact, rather, context is mostly intended to be a setter, not a getter. When you set the context, all top-level document objects will be informed and the ContextChanged event will be raised.
public GH_DocumentContext Context { get; set; }

CustomRenderObjects

#
Enumerate over all enabled, rendering, non-empty custom preview objects.
[EditorBrowsable(EditorBrowsableState.Never)] public IEnumerable<GH_CustomPreviewComponent> CustomRenderObjects { get; }

DefaultPreviewColour

#
Gets or sets the default preview colour for normal objects.
public static Color DefaultPreviewColour { get; set; }

DefaultSelectedPreviewColour

#
Gets or sets the default preview colour for normal objects.
public static Color DefaultSelectedPreviewColour { get; set; }

DisplayName

#
Gets the display name for this document. The display name is highly context sensitive and is only supposed to give the user a good idea of which document this is and whether it has been modified.
public string DisplayName { get; }

DocumentID

#
Gets the document Id. The Id is assigned at construction and never changed. Note: clusters may choose to modify the Id of their internal documents.
public Guid DocumentID { get; }

Enabled

#
Gets or sets the enabled state for this document. Enabled documents respond to events and display their previews in the Rhino viewport.
public bool Enabled { get; set; }

EnableSolutions

#
Gets or sets a global variable that indicates whether solutions are allowed to be recomputed. When this flag is off, the solver will be disabled and the event watchers should be silent.
public static bool EnableSolutions { get; set; }

EventServer

#
Gets the event server that belongs to this document. The Event server may be in an inactive state, but it is never null.
public GH_DocumentEventServer EventServer { get; }

FileNameProxy

#
[EditorBrowsable(EditorBrowsableState.Never)] public string FileNameProxy { get; }
obsoleteThis property is obsolete, please use the DisplayName property instead

FilePath

#
Gets or sets the file path of this document. If the file path is not set Nothing is returned.
public string FilePath { get; set; }

IgnoredCount

#
Returns the total numbers of components currently in the Object Exception Ignore List.
public int IgnoredCount { get; }

IsFilePathDefined

#
Returns True if the filename flag of this document has been set
public bool IsFilePathDefined { get; }

IsModified

#
Gets or sets the modified flag. If the new value differs from the old value, the ModifiedChanged() event is raised.
public bool IsModified { get; set; }

ModifiedSubsidiaries

#
Gets the number of modified subsidiary documents.
public int ModifiedSubsidiaries { get; }
The number of modified subsidiary documents.

Nested

#
Gets or sets whether this document is nested. A nested document is always part of some other document and is therefore unknown to the DocumentServer and the Canvas.
public bool Nested { get; set; }

ObjectCount

#
Returns the total number of top-level objects in the document.
public int ObjectCount { get; }

Objects

#
Returns a list of all normal, top-level objects.
public IList<IGH_DocumentObject> Objects { get; }

ObjectSpan

#
Gets the total timespan for all objects.
public TimeSpan ObjectSpan { get; }

Owner

#
Gets or sets the owner of this document. A document is typically owned when it is subsidiary to some object, such as a cluster.
public IGH_DocumentOwner Owner { get; set; }

PreviewBoundary

#
Gets or sets the preview boundary applied to this document. If a boundary has been set, only those objects which are inside the boundary will be previewed.
public GH_PreviewBoundary PreviewBoundary { get; set; }

PreviewBoundingBox

#
Gets the boundingbox used for previews.
public BoundingBox PreviewBoundingBox { get; }

PreviewColour

#
Gets or sets the colour of unselected preview geometry.
public Color PreviewColour { get; set; }

PreviewColourSelected

#
Gets or sets the colour of selected preview geometry.
public Color PreviewColourSelected { get; set; }

PreviewCustomMeshParameters

#
Gets or sets the Custom Meshing Parameters for this document, these are only used when PreviewMeshType = GH_PreviewMesh.Custom
public MeshingParameters PreviewCustomMeshParameters { get; set; }

PreviewFilter

#
Gets or set the preview filter.
public GH_PreviewFilter PreviewFilter { get; set; }

PreviewMeshType

#
Gets or sets the preview mesh type for this document.
public GH_PreviewMesh PreviewMeshType { get; set; }

PreviewMode

#
Gets or sets the preview display mode and makes sure the conduit instance of this class is set to match.
public GH_PreviewMode PreviewMode { get; set; }

Profiler

#
Gets or sets the profiler mode used in this document.
public GH_ProfilerMode Profiler { get; set; }

Properties

#
The properties of this document
public GH_DocumentProperties Properties { get; }

RaiseEvents

#
If RaiseEvents is set to false, all the On....() methods of this document will stop raising events.
public bool RaiseEvents { get; set; }

RemotePanelLayout

#
Gets the Remote Control Panel layout for this document.
public RcpLayout RemotePanelLayout { get; }

RhinoDocument

#
public RhinoDoc RhinoDocument { get; }

RuntimeID

#
Gets the runtime ID of this document. RuntimeID is assigned once and never changed. It is also not deserialized so every document will always have a unique ID when loaded.
public ulong RuntimeID { get; }

ScheduleDelay

#
Gets the delay for the next scheduled solution. If there is no solution scheduled the delay will be negative.
public int ScheduleDelay { get; }

SelectedCount

#
Gets the number of selected objects
public int SelectedCount { get; }

SelectionTopology

#
Gets the selection topology of the document.
public GH_SelectionTopology SelectionTopology { get; }

SolutionDepth

#
Gets the number of nested solutions currently running. If no solutions are running, the depth should be zero. If one solution is runnnig, the depth should be one. Higher depths are only possible if a new solution was scheduled from within an existing solution with delay=0ms.
public int SolutionDepth { get; }

SolutionHistory

#
Gets a list of the last 1000 solution timespans, from oldest to youngest.
public List<GH_SolutionSpan> SolutionHistory { get; }

SolutionSpan

#
Gets the timespan for the most recent solution.
public TimeSpan SolutionSpan { get; }

SolutionState

#
Gets the state of this document.
public GH_ProcessStep SolutionState { get; }

StateServer

#
Gets the list of stored states in this document
public GH_StateServer StateServer { get; }

Thumbnail

#
Gets or sets the thumbnail bitmap for this document.
public Bitmap Thumbnail { get; set; }

UndoServer

#
Gets the UndoServer instance that belongs to this document.
public GH_UndoServer UndoServer { get; }

UndoUtil

#
Gets a temporary undo utility instance that allows you to easily create standard undo events.
public GH_Document.GH_UndoUtil UndoUtil { get; }
A new instance of GH_UndoUtil set up to work with this document. Do not hang on to this object, ask for a new one every time you need it.

ValueTable

#
Gets the value table associated with this document.
public GH_SettingsServer ValueTable { get; }

Methods

ActiveObjects

#
Returns all normal objects in the document that implement the IGH_ActiveObject interface
public List<IGH_ActiveObject> ActiveObjects()

AddObject

#
Add a new object to the document. If the object is already contained, nothing will happen
public bool AddObject(
docObject,
The object to add.
update,
If True, a new solution will be triggered afterwards, regardless of event response settings.
index = 2147483647
Index at which object will be inserted.
)

AlignObjects

#
Perform alignment and distribution logic on a set of objects.
public void AlignObjects()

AlignObjects

#
Perform alignment and distribution logic on all selected objects.
public void AlignObjects(
align,
distribute
)

AppendToDebugLog

#
Useful for creating textual representations of this document for debugging purposes.
public void AppendToDebugLog()
AppendToDebugLog

ArrangeObject

#
Rearrange the stack order of the object.
public bool ArrangeObject(
obj,
Object to move.
motion
Direction to move in.
)

ArrangeObjects

#
Rearrange the stack order of a collection of objects.
public bool ArrangeObjects(
objs,
Objects to move.
motion
Direction to move in.
)

AssociateWithRhinoDocument

#
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 void AssociateWithRhinoDocument()

AutoLayoutComponents

#
Perform automatic layout on this document.
public void AutoLayoutComponents(
limitToSelection
If true, only selected objects will be considered.
)

AutoSave

#
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 bool AutoSave(
trigger,
Reason for autosave. User can choose to ignore certain autosave reasons.
id
Guid of autosave operation, consecutive calls to autosave with the same Guid will be ignored.
)

AutoSave

#
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 bool AutoSave(
trigger
Reason for autosave. User can choose to ignore certain autosave reasons.
)

AutoSaveFileName

#
Computes the autosave filename for a full grasshopper filepath.
public static string AutoSaveFileName(
filename
Full path of Grasshopper file, including directories and extension.
)
The autosave filename (but not including the autosave directory).

BoundingBox

#
Returns the boundingbox of all the normal attributes. If the document contains no normal attributes an Empty RectangleF structure is returned.
public RectangleF BoundingBox(
limitToSelection = false
If true, only selected attributes are included in the boundingbox computation.
)
The boundingbox of the requested objects or RectangleF.Empty if no objects could be found.

BringSelectionToTop

#
Move the selection set to the top of the visible stack
public void BringSelectionToTop()

ClearIgnoreList

#
Clears the Object Exception Ignore List.
public void ClearIgnoreList()

ClearReferenceTable

#
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 void ClearReferenceTable()

CloseAllSubsidiaries

#
Iterate over all subsidiary documents and close them all without saving.
public int CloseAllSubsidiaries()
The number of subsidiary documents that was closed.

ClusterInputHooks

#
Gets a sorted list of all the cluster input hooks.
public GH_ClusterInputHook[] ClusterInputHooks()
A list of hooks in the proper order (from top to bottom, left to right).

ClusterInstanceCount

#
Counts the number of instances of a specific cluster document ID.
public int ClusterInstanceCount(
id
The cluster document id to search for.
)
The number of instances of a specific cluster.

ClusterOutputHooks

#
Gets a sorted list of all the cluster output hooks.
public GH_ClusterOutputHook[] ClusterOutputHooks()
A list of hooks in the proper order (from top to bottom, left to right).

CompareTo

#
Compare two documents. This function does not compare document content.
public int CompareTo(
other
Document to compare to.
)
Comparison key.

ConstructDocumentTree

#
Create a hierarchical document tree of ownership with this document as the root.
public GH_DocumentTree ConstructDocumentTree()
A tree of all documents owned directly or indirectly by this document.

ContainsClusterHooks

#
Tests whether this document contains at least one cluster hook.
public bool ContainsClusterHooks()

ConvertFullNamesToNickNames

#
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 void ConvertFullNamesToNickNames()

ConvertNickNamesToFullNames

#
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 void ConvertNickNamesToFullNames()

CreateAutomaticClusterHooks

#
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 void CreateAutomaticClusterHooks()

CreateConnectivityDiagram

#
Gets the connectivity diagram for the current state of this document.
public GH_ConnectivityDiagram CreateConnectivityDiagram()
The connectivity diagram of the current state. Once objects/wires are added or removed the diagram will not update and you must request a new one.

CreateExpressionParser

#
Create a new Expression Solver preloaded with the constants defined in this document.
public GH_ExpressionParser CreateExpressionParser()

DefineConstant

#
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 void DefineConstant(
name,
Name of constant.
value
Value of constant.
)

DeselectAll

#
Deselect all top-level attributes.
public void DeselectAll()

DestroyAttributeCache

#
Destroys the Attribute cache. Call this function whenever you do something which might affect attributes.
public void DestroyAttributeCache()

DestroyAutoSaveFiles

#
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 void DestroyAutoSaveFiles()

DestroyObjectTable

#
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 void DestroyObjectTable()

DestroyPreviewCaches

#
Wipe all caches for Viewport Preview logic.
public void DestroyPreviewCaches()

DestroyPreviewMeshes

#
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 void DestroyPreviewMeshes()

DestroyProxySources

#
Remove all remaining proxy sources from the document.
public void DestroyProxySources()

DisabledObjects

#
Returns all disabled objects in the document
public List<IGH_DocumentObject> DisabledObjects()

Dispose

#
When you discard documents you must call Dispose or the Viewport Display event handlers will not be disconnected.
public void Dispose()

DuplicateDocument

#
Attempt to duplicate a document.
public static GH_Document DuplicateDocument(
doc
Document to copy.
)
A document similar to the input on success, or nothing on failure.

EnabledObjects

#
Returns all enabled objects in the document
public List<IGH_DocumentObject> EnabledObjects()

ExpandSelection

#
Grow or shift the selection set based on source and recipient links
public void ExpandSelection(
Upstream = true,
If True, the selection will grow/shift upstream
Downstream = true,
If True, the selection will grow/shift downstream
GrowSelection = true
If True, the current selection set is retained. If False, the current selection set is discarded
)

ExpirePreview

#
Expires the preview caches of the conduit.
public void ExpirePreview(
redraw
)

ExpireSolution

#
Expire the entire solution. This will blank all objects.
public void ExpireSolution()

FilterActive

#
Filter a list of objects.
public static List<IGH_ActiveObject> FilterActive(
in
The object list to filter
)
A list containing only the objects that implement the IGH_ActiveObject interface

FilterDisabled

#
Filter a list of objects.
public static List<IGH_DocumentObject> FilterDisabled(
in
The object list to filter
)
A list containing only the disabled objects

FilterEnabled

#
Filter a list of objects.
public static List<IGH_DocumentObject> FilterEnabled(
in
The object list to filter
)
A list containing only the enabled objects

FilterInactive

#
Filter a list of objects.
public static List<IGH_ActiveObject> FilterInactive(
in
The object list to filter
)
A list containing only the objects that don't implement the IGH_ActiveObject interface

FilterObjects

#
Returns all objects in the document that pass the filter specification
public List<IGH_DocumentObject> FilterObjects(
selectedObjects = GH_Filter.DontCare,
enabledObjects = GH_Filter.DontCare,
activeObjects = GH_Filter.DontCare
)

FilterObjects

#
Filter a list of objects using several filters at once
public static List<IGH_DocumentObject> FilterObjects(
in,
The set to filter
bSelectedObjects = GH_Filter.DontCare,
Filter (non)selected objects only
bEnabledObjects = GH_Filter.DontCare,
Filter (non)enabled objects only
bActiveObjects = GH_Filter.DontCare
Filter (non)active objects only
)
A list with all objects that pass all filters

FilterSelected

#
Filter a list of objects.
public static List<IGH_DocumentObject> FilterSelected(
in
The object list to filter
)
A list containing only the selected objects

FilterUnselected

#
Filter a list of objects.
public static List<IGH_DocumentObject> FilterUnselected(
in
The object list to filter
)
A list containing only the unselected objects

Finalize

#
protected override void Finalize()
Object.Finalize

FindAllDownstreamObjects

#
Find all objects that depend in some way on the Source.
public List<IGH_ActiveObject> FindAllDownstreamObjects(
from,
Object to start searching from.
filter
The inclusion delegate
)

FindAllDownstreamObjects

#
Find all objects that depend in some way on the Source.
public List<IGH_ActiveObject> FindAllDownstreamObjects(
from
Object to start searching from.
)

FindAllDownstreamObjects

#
Find all objects that depend in some way on the Source collection
public List<IGH_ActiveObject> FindAllDownstreamObjects(
from,
Objects to start searching from.
filter
The inclusion delegate
)

FindAllDownstreamObjects

#
Find all objects that depend in some way on the Source collection
public List<IGH_ActiveObject> FindAllDownstreamObjects(
from
Objects to start searching from.
)

FindAttribute

#
Find the object that matches the ID
public IGH_Attributes FindAttribute(
id
the ID to search for
)

FindAttribute

#
Search for attributes that contain a certain point.
public IGH_Attributes FindAttribute(
PointF
pt,
The point in Canvas coordinates
topLevelOnly
If true, child attributes will be skipped.
)

FindAttributeByGrip

#
Search for attributes that contain grips near the search locus
public IGH_Attributes FindAttributeByGrip(
PointF
pt,
Pixel for search start
bLimitToOutside,
If true, grips are ignored if the pt is on the 'inside' side.
bIncludeInputs,
bIncludeOutputs,
SearchRadius = 12
Radius of search
)

FindAttributeByGrip

#
Search for attributes that contain grips near the search locus
public IGH_Attributes FindAttributeByGrip(
PointF
pt,
Pixel for search start
bLimitToOutside,
If true, grips are ignored if the pt is on the 'inside' side.
SearchRadius = 12
Radius of search
)

FindClusters

#
Find all the clusters that have a matching ID.
public List<GH_Cluster> FindClusters(
id
Cluster DocumentID to search for.
)
A list of all the clusters that match the ID.

FindClusters

#
Find all the clusters that have a matching filepath.
public List<GH_Cluster> FindClusters(
filepath
Cluster FilePath to search for.
)
A list of all the clusters that match the filepath.

FindComponent

#
Search for components using an ID filter
public IGH_Component FindComponent(
id
ID to search for
)
The component with the ID, or Null if no component could be found

FindComponent

#
Search for components that contain the locus
public IGH_Component FindComponent(
Point
pt
The point to search for
)

FindFloatingParameter

#
Search for floating parameters that contain the locus
public IGH_Param FindFloatingParameter(
Point
pt
Point for search start
)

FindInputParameter

#
Search for input (upstream) parameters that contain the locus
public IGH_Param FindInputParameter(
Point
pt
Point for search start
)

FindObject

#
Find the object that matches the ID.
public IGH_DocumentObject FindObject(
id,
The ID to search for.
topLevelOnly
If True, only top-level objects are included. If False, the entire object attribute tree is recursed
)

FindObject

#
Find the topmost object that is closest to the point
public IGH_DocumentObject FindObject(
PointF
pt,
Canvas coordinates for object lookup
radius
Radius, (in canvas units) for search.
)

FindObject<T>

#
Find the object that matches the ID.
public T FindObject<T>(
id,
The ID to search for.
topLevelOnly
If True, only top-level objects are included. If False, the entire object attribute tree is recursed
)

FindObjects

#
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 List<IGH_DocumentObject> FindObjects(
keys,
maxCount
)

FindOutputParameter

#
Search for output (downstream) parameters that contain the locus
public IGH_Param FindOutputParameter(
Point
pt
Point for search start
)

FindParameter

#
Search for parameters using an ID filter
public IGH_Param FindParameter(
id
ID to search for
)
The parameter with the ID, or Null if no parameter could be found

FindWireAt

#
Find the wire at or near the given coordinate.
public bool FindWireAt(
PointF
point,
Search locus.
radius,
Search radius.
source,
Source parameter of wire (if found).
target
Target parameter of wire (if found).
)
True if a wire was found.

ForcePreview

#
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 void ForcePreview(
previewOn
)

GetAllInstanceIDs

#
Get a sorted list of all the IGH_DocumentObject instance IDs in this document.
public SortedList<Guid, int> GetAllInstanceIDs(
topLevelOnly
If true, only top level objects are considered.
)
A sorted fictionary of IDs and Integers. The integers represent the indices of the top-level objects that contained the ids. Since the object list inside a GH_Document is not static, these indices will not remain valid.

InactiveObjects

#
Returns all objects in the document that don't implement the IGH_ActiveObject interface
public List<IGH_ActiveObject> InactiveObjects()

InvertSelection

#
Invert the selected state of all top-level attributes.
public void InvertSelection()

IsEscapeKeyDown

#
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 static bool IsEscapeKeyDown()
Remarks: If GetAsyncKeyState is called by some other application, it will mess with the value returned here, as GetAsyncKeyState is a system wide static method.
True if escape was/is pressed, false if otherwise.

IsRenderMeshPipelineViewport

#
Test to see whether a pipeline should have custom render meshes vs. previews.
public bool IsRenderMeshPipelineViewport(
pipeline
Display pipeline.
)
True if custom meshes ought to be used rather than previews.

MergeDocument

#
Hoist all objects from another document into this one.
public bool MergeDocument(
other,
The other document. Cannot be null.
resolveProxies,
If True, an attempt is made to repair proxy sources after insertion.
removeProxies
If True, all remaining proxies will be deleted.
)
Remarks: The objects will be moved, not copied. The other document ends up being empty since objects can only belong to one document at a time.

MergeDocument

#
Hoist all objects from another document into this one.
public bool MergeDocument(
other,
The other document. Cannot be Null or
resolveProxies
If True, an attempt is made to repair proxy sources after insertion.
)
Remarks: The objects will be moved, not copied. The other document ends up being empty since objects can only belong to one document at a time.

MergeDocument

#
Hoist all objects from another document into this one.
public bool MergeDocument(
other
The other document. Cannot be Null or
)
Remarks: The objects will be moved, not copied. The other document ends up being empty since objects can only belong to one document at a time.

Modified

#
Sets the modified flag of this document.
public void Modified()

MutateAllGUIDs

#
[EditorBrowsable(EditorBrowsableState.Never)] public void MutateAllGUIDs()
obsoleteThis method has been replaced by MutateAllIds

MutateAllIds

#
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 void MutateAllIds()

NewSolution

#
Start a new solution.
public void NewSolution(
expireAllObjects,
If True, all objects will be recalculated. If False, only already expired objects will be recalculated.
mode
Solution mode. Only use CommandLine or Silent if your solution runs in the background.
)

NewSolution

#
Start a new solution.
public void NewSolution(
expireAllObjects
If True, all objects will be recalculated. If False, only already expired objects will be recalculated.
)

NonBlankFilter

#
This delegate can be used in the FindAllDownstreamObjects(...) methods. Only includes objects that are non-blank and non-failed.
public static bool NonBlankFilter()

NullFilter

#
This delegate can be used in the FindAllDownstreamObjects(...) methods. Includes all objects.
public static bool NullFilter()

OnContextChanged

#
Raise the ContextChanged event.
public void OnContextChanged()

OnEnabledChanged

#
Raise the EnabledChanged event.
public void OnEnabledChanged()

OnFilePathChanged

#
Raise the FilePathChanged event.
public void OnFilePathChanged(
old,
Old filepath.
new
New filepath.
)

OnModifiedChanged

#
Raise the ModifiedChanged event
public void OnModifiedChanged()

OnObjectAdded

#
Raise the ObjectsAdded event.
public void OnObjectAdded(
doc_object
Object that was added.
)

OnObjectDeleted

#
Raise the ObjectsDeleted event.
public void OnObjectDeleted(
doc_object
Object that was deleted.
)

OnObjectsAdded

#
Raise the ObjectsAdded event.
public void OnObjectsAdded(
doc_objects
Objects that were added.
)

OnObjectsDeleted

#
Raise the ObjectsDeleted event.
public void OnObjectsDeleted(
doc_objects
Objects that were deleted.
)

OnSettingsChanged

#
Raise the SettingsChanged event.
public void OnSettingsChanged()

OnUndoStateChanged

#
Raise the UndoStateChanged event.
public void OnUndoStateChanged(
op,
Type of undo operation to provide with the Event arguments.
rec
Record to provide in the Event arguments.
)

PreviewCurrentMeshParameters

#
Gets the currently relevant meshing parameters (do not modify the instance as it may be shared).
public MeshingParameters PreviewCurrentMeshParameters()

Read

#
Standard archiving function. Will deserialize the entire document.
public bool Read(
reader
)
Read

Redo

#
Perform the first redo event.
public bool Redo()
True on success, false on no redo event or invalid redo event.

RelevantObjectAtPoint

#
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 GH_RelevantObjectData RelevantObjectAtPoint(
PointF
pt,
The point to test.
searchFilter
)
Information about the most relevant object or Null if no relevant object could be found at the given point.

RelevantObjectAtPoint

#
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 GH_RelevantObjectData RelevantObjectAtPoint(
PointF
pt
The point to test.
)
Information about the most relevant object or Null if no relevant object could be found at the given point.

RemoveObject

#
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 bool RemoveObject(
attribute,
update
)

RemoveObject

#
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 bool RemoveObject(
docObject,
Object to remove.
update
)

RemoveObjects

#
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 int RemoveObjects(
objectList,
Objects to remove from this document.
update
If True, the solution will be recomputed.
)
The number of objects actually deleted.

RemoveSelection

#
Delete all the objects in the selection set. This method does not record an Undo event, that is the responsibility of the caller.
public void RemoveSelection(
update
If True, the solution will be recomputed.
)

RepairProxySources

#
Attempts to resolve all proxy sources in the document.
public bool RepairProxySources()
False if one or more proxies could not be resolved

ReplaceProxySources

#
Replace all remaining proxy sources in the document with UnresolvedProxy Objects.
public void ReplaceProxySources()

RequestAbortSolution

#
Set the AbortRequested 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 void RequestAbortSolution()

RunningAsCommand

#
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 Command RunningAsCommand()
executing command when running as a command; otherwise null

ScheduleSolution

#
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 void ScheduleSolution(
delay,
The delay (in milliseconds) between the completion of this solution and the start of the scheduled solution. If the delay is 1ms or more, a timer will be used to trigger a new solution sometime in the future. If a delay of 0ms is used, then the next solution will run recursively within the current solution. You should not use a delay of zero milliseconds too often as it will cause the Rhino process to run out of stack-space. The SolutionDepth property can be used to see how deeply recursive the solution currently is.
callback
If not null, the callback will be called before the scheduled solution is triggered.
)

ScheduleSolution

#
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 void ScheduleSolution(
delay
The delay (in milliseconds) between the completion of this solution and the start of the scheduled solution. If the delay is 1ms or more, a timer will be used to trigger a new solution sometime in the future. If a delay of 0ms is used, then the next solution will run recursively within the current solution. You should not use a delay of zero milliseconds too often as it will cause the Rhino process to run out of stack-space. The SolutionDepth property can be used to see how deeply recursive the solution currently is.
)

Select

#
Default pick selection behaviour
public GH_SelectionState Select(
obj_dat,
Information regarding the object to be selected.
bAdd,
If True, it will add the topmost unselected object that contains pt to the selection set. If False, the selection set will be cleared when an unselected object is picked
bRemove
If True, it will remove the topmost selected object that contains pt from the selection set.
)

Select

#
Default pick selection behaviour. (looks at current Shift + Control modifier states to determine addition/removal)
public GH_SelectionState Select(
obj_dat
Information regarding the object to be selected.
)

SelectAll

#
Select all top-level attributes.
public void SelectAll()

SelectedObjects

#
Returns all selected objects in the document
public List<IGH_DocumentObject> SelectedObjects()

SetEnabledFlags

#
Set the enabled flags of all selected objects to true or false
public void SetEnabledFlags(
bEnable
)

SetEnabledFlags

#
Set the enabled flags of all specified objects to true or false
public void SetEnabledFlags(
objects,
bEnable
)

SetPreviewFlags

#
Set the preview flags of all selected objects to true or false
public void SetPreviewFlags(
bPreview
)

SetPreviewFlags

#
Set the preview flags of all specified objects to true or false
public void SetPreviewFlags(
objects,
bPreview
)

SetStatusBarEventHelper

#
public void SetStatusBarEventHelper()

ShowPreviewSettings

#
Display the Preview settings dialog.
public void ShowPreviewSettings()

SolutionProgress

#
Returns the progress of the current solution.
public int SolutionProgress(
ref int
objectIndex,
The index of the object currently being solved.
ref int
maximumIndex
The highest index.
)
Percentage of solution as a number between 1 and 99 inclusive.

ToggleEnabledFlags

#
Toggle the enabled flags of all selected objects
public void ToggleEnabledFlags()

ToggleEnabledFlags

#
Toggle the enabled flags of all specified objects
public void ToggleEnabledFlags()

TogglePreviewFlags

#
Toggle the preview flags of all selected objects
public void TogglePreviewFlags()

TogglePreviewFlags

#
Toggle the preview flags of all specified objects
public void TogglePreviewFlags()

ToString

#
A document serializes itself using the filename of the current path. This is useful for sorting purposes and ListBoxes.
public override string ToString()
Object.ToString

TranslateObjects

#
Offset objects by a certain distance in X and Y
public void TranslateObjects(
Size
trXForm,
Translation vector
bLimitToSelection
If True, only selected objects are affected
)

Undo

#
Perform the first undo event.
public bool Undo()
True on success, false on no undo event or invalid undo event.

UnselectedObjects

#
Returns all unselected objects in the document
public List<IGH_DocumentObject> UnselectedObjects()

UpdateAllSubsidiaries

#
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 int UpdateAllSubsidiaries()
The number of subsidiary documents updated.

Write

#
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.
public bool Write(
writer,
Writer to serialize with.
objList
Object list override
)

Write

#
Standard archiving function. Will serialize the entire document.
public bool Write(
writer
)
Write

Events

ContextChanged

#
The context for this document was changed.
public event GH_Document.ContextChangedEventHandler ContextChanged

DefaultPreviewColourChanged

#
This even is raised whenever the global default for Normal preview colour is changed.
public static event GH_Document.DefaultPreviewColourChangedEventHandler DefaultPreviewColourChanged

DefaultSelectedPreviewColourChanged

#
This even is raised whenever the global default for Selected preview colour is changed.
public static event GH_Document.DefaultSelectedPreviewColourChangedEventHandler DefaultSelectedPreviewColourChanged

EnabledChanged

#
The Enabled state was changed on this document.
public event GH_Document.EnabledChangedEventHandler EnabledChanged

EnableSolutionsChanged

#
Raised whenever the Shared EnabledSolutions property is changed.
public static event GH_Document.EnableSolutionsChangedEventHandler EnableSolutionsChanged

FilePathChanged

#
Raised whenever the FilePath of the document is modified.
public event GH_Document.FilePathChangedEventHandler FilePathChanged

ModifiedChanged

#
The modified flag on the document was changed.
public event GH_Document.ModifiedChangedEventHandler ModifiedChanged

ObjectsAdded

#
Raised after a collection of objects was added to the document.
public event GH_Document.ObjectsAddedEventHandler ObjectsAdded

ObjectsDeleted

#
Raised after a collection of objects was removed from the document. At this point, the objects still exist, but they no longer belong to this document.
public event GH_Document.ObjectsDeletedEventHandler ObjectsDeleted

SettingsChanged

#
Some settings of the document were changed.
public event GH_Document.SettingsChangedEventHandler SettingsChanged

SolutionEnd

#
This event is raised whenever a new solution request has been handled. Even if the document is locked.
public event GH_Document.SolutionEndEventHandler SolutionEnd

SolutionStart

#
This event is raised whenever a new solution is requested. Even if the document is locked.
public event GH_Document.SolutionStartEventHandler SolutionStart

UndoStateChanged

#
Raised whenever there is a change to the document undo/redo stack.
public event GH_Document.UndoStateChangedEventHandler UndoStateChanged