GH_Document Class |
Namespace: Grasshopper.Kernel
The GH_Document type exposes the following members.
Name | Description | |
---|---|---|
GH_Document |
Constructor for GH_Document. Makes sure all important members are initialized.
|
Name | Description | |
---|---|---|
AbortRequested |
Gets the abortrequested flag state.
| |
ActiveDoc |
Gets or sets a value indicating that this document was last active in a multi-doc aware Rhino.
| |
AttributeCount |
Returns the total number of attributes in the document. Both Normal and Hidden ones
| |
Attributes |
Returns a list of all the attributes in this document. This includes attributes
for nested objects such as input or output parameters.
| |
Author |
Gets the author details associated with this document.
| |
ConstantServer |
Gets the dictionary of constants defined in this document.
| |
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.
| |
DefaultPreviewColour |
Gets or sets the default preview colour for normal objects.
| |
DefaultSelectedPreviewColour |
Gets or sets the default preview colour for normal objects.
| |
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.
| |
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.
| |
Enabled |
Gets or sets the enabled state for this document.
Enabled documents respond to events and display their previews in the Rhino viewport.
| |
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.
| |
EventServer |
Gets the event server that belongs to this document.
The Event server may be in an inactive state, but it is never null.
| |
FilePath |
Gets or sets the file path of this document. If the file path is not set Nothing is returned.
| |
IgnoredCount |
Returns the total numbers of components currently in the Object Exception Ignore List.
| |
IsFilePathDefined |
Returns True if the filename flag of this document has been set
| |
IsModified |
Gets or sets the modified flag. If the new value differs from the old value, the ModifiedChanged() event is raised.
| |
ModifiedSubsidiaries |
Gets 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.
| |
ObjectCount |
Returns the total number of top-level objects in the document.
| |
Objects |
Returns a list of all normal, top-level objects.
| |
ObjectSpan |
Gets the total timespan for all objects.
| |
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.
| |
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.
| |
PreviewBoundingBox |
Gets the boundingbox used for previews.
| |
PreviewColour |
Gets or sets the colour of unselected preview geometry.
| |
PreviewColourSelected |
Gets or sets the colour of selected preview geometry.
| |
PreviewCustomMeshParameters |
Gets or sets the Custom Meshing Parameters for this document,
these are only used when PreviewMeshType = GH_PreviewMesh.Custom
| |
PreviewFilter |
Gets or set the preview filter.
| |
PreviewMeshType |
Gets or sets the preview mesh type for this document.
| |
PreviewMode |
Gets or sets the preview display mode and makes sure the conduit instance of this class is set to match.
| |
Profiler |
Gets or sets the profiler mode used in this document.
| |
Properties |
The properties of this document
| |
RaiseEvents |
If RaiseEvents is set to false, all the On....() methods of this document will stop raising events.
| |
RemotePanelLayout |
Gets the Remote Control Panel layout for this document.
| |
RhinoDocument | ||
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.
| |
ScheduleDelay |
Gets the delay for the next scheduled solution.
If there is no solution scheduled the delay will be negative.
| |
SelectedCount |
Gets the number of selected objects
| |
SelectionTopology |
Gets the selection topology of the document.
| |
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.
| |
SolutionHistory |
Gets a list of the last 1000 solution timespans, from oldest to youngest.
| |
SolutionSpan |
Gets the timespan for the most recent solution.
| |
SolutionState |
Gets the state of this document.
| |
StateServer |
Gets the list of stored states in this document
| |
Thumbnail |
Gets or sets the thumbnail bitmap for this document.
| |
UndoServer |
Gets the UndoServer instance that belongs to this document.
| |
UndoUtil |
Gets a temporary undo utility instance that allows you to easily create standard undo events.
| |
ValueTable |
Gets the value table associated with this document.
|
Name | Description | |
---|---|---|
ActiveObjects |
Returns all normal objects in the document that implement the IGH_ActiveObject interface
| |
AddObject |
Add a new object to the document. If the object is already contained, nothing will happen
| |
AlignObjects(GH_Align, GH_Distribute) |
Perform alignment and distribution logic on all selected objects.
| |
AlignObjects(GH_Align, GH_Distribute, ListIGH_DocumentObject) |
Perform alignment and distribution logic on a set of objects.
| |
AppendToDebugLog |
Useful for creating textual representations of this document for debugging purposes.
| |
ArrangeObject |
Rearrange the stack order of the object.
| |
ArrangeObjects |
Rearrange the stack order of a collection of objects.
| |
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.
| |
AutoLayoutComponents |
Perform automatic layout on this document.
| |
AutoSave(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.
| |
AutoSave(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.
| |
AutoSaveFileName |
Computes the autosave filename for a full grasshopper filepath.
| |
BoundingBox |
Returns the boundingbox of all the normal attributes. If the document contains no
normal attributes an Empty RectangleF structure is returned.
| |
BringSelectionToTop |
Move the selection set to the top of the visible stack
| |
ClearIgnoreList |
Clears the Object Exception Ignore List.
| |
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.
| |
CloseAllSubsidiaries |
Iterate over all subsidiary documents and close them all without saving.
| |
ClusterInputHooks |
Gets a sorted list of all the cluster input hooks.
| |
ClusterInstanceCount |
Counts the number of instances of a specific cluster document ID.
| |
ClusterOutputHooks |
Gets a sorted list of all the cluster output hooks.
| |
CompareTo |
Compare two documents. This function does not compare document content.
| |
ConstructDocumentTree |
Create a hierarchical document tree of ownership with this document as the root.
| |
ContainsClusterHooks |
Tests whether this document contains at least one cluster hook.
| |
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.
| |
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.
| |
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.
| |
CreateConnectivityDiagram |
Gets the connectivity diagram for the current state of this document.
| |
CreateExpressionParser |
Create a new Expression Solver preloaded with the constants defined in this document.
| |
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.
| |
DeselectAll |
Deselect all top-level attributes.
| |
DestroyAttributeCache |
Destroys the Attribute cache. Call this function whenever you do something which might affect attributes.
| |
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.
| |
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.
| |
DestroyPreviewCaches |
Wipe all caches for Viewport Preview logic.
| |
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.
| |
DestroyProxySources |
Remove all remaining proxy sources from the document.
| |
DisabledObjects |
Returns all disabled objects in the document
| |
Dispose |
When you discard documents you must call Dispose or the Viewport Display event handlers will not be disconnected.
| |
DuplicateDocument |
Attempt to duplicate a document.
| |
EnabledObjects |
Returns all enabled objects in the document
| |
ExpandSelection |
Grow or shift the selection set based on source and recipient links
| |
ExpirePreview |
Expires the preview caches of the conduit.
| |
ExpireSolution |
Expire the entire solution. This will blank all objects.
| |
FilterActive |
Filter a list of objects.
| |
FilterDisabled |
Filter a list of objects.
| |
FilterEnabled |
Filter a list of objects.
| |
FilterInactive |
Filter a list of objects.
| |
FilterObjects(GH_Filter, GH_Filter, GH_Filter) |
Returns all objects in the document that pass the filter specification
| |
FilterObjects(ListIGH_DocumentObject, GH_Filter, GH_Filter, GH_Filter) |
Filter a list of objects using several filters at once
| |
FilterSelected |
Filter a list of objects.
| |
FilterUnselected |
Filter a list of objects.
| |
FindAllDownstreamObjects(IGH_ActiveObject) |
Find all objects that depend in some way on the Source.
| |
FindAllDownstreamObjects(ListIGH_ActiveObject) |
Find all objects that depend in some way on the Source collection
| |
FindAllDownstreamObjects(IGH_ActiveObject, GH_DocumentGH_ActiveObjectFilter) |
Find all objects that depend in some way on the Source.
| |
FindAllDownstreamObjects(ListIGH_ActiveObject, GH_DocumentGH_ActiveObjectFilter) |
Find all objects that depend in some way on the Source collection
| |
FindAttribute(Guid) |
Find the object that matches the ID
| |
FindAttribute(PointF, Boolean) |
Search for attributes that contain a certain point.
| |
FindAttributeByGrip(PointF, Boolean, Int32) |
Search for attributes that contain grips near the search locus
| |
FindAttributeByGrip(PointF, Boolean, Boolean, Boolean, Int32) |
Search for attributes that contain grips near the search locus
| |
FindClusters(Guid) |
Find all the clusters that have a matching ID.
| |
FindClusters(String) |
Find all the clusters that have a matching filepath.
| |
FindComponent(Guid) |
Search for components using an ID filter
| |
FindComponent(Point) |
Search for components that contain the locus
| |
FindFloatingParameter |
Search for floating parameters that contain the locus
| |
FindInputParameter |
Search for input (upstream) parameters that contain the locus
| |
FindObject(Guid, Boolean) |
Find the object that matches the ID.
| |
FindObject(PointF, Single) |
Find the topmost object that is closest to the point
| |
FindObjectT(Guid, Boolean) |
Find the object that matches the ID.
| |
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.
| |
FindOutputParameter |
Search for output (downstream) parameters that contain the locus
| |
FindParameter |
Search for parameters using an ID filter
| |
FindWireAt |
Find the wire at or near the given coordinate.
| |
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.
| |
GetAllInstanceIDs |
Get a sorted list of all the IGH_DocumentObject instance IDs in this document.
| |
InactiveObjects |
Returns all objects in the document that don't implement the IGH_ActiveObject interface
| |
InvertSelection |
Invert the selected state of all top-level attributes.
| |
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.
| |
IsRenderMeshPipelineViewport |
Test to see whether a pipeline should have custom render meshes vs. previews.
| |
MergeDocument(GH_Document) |
Hoist all objects from another document into this one.
| |
MergeDocument(GH_Document, Boolean) |
Hoist all objects from another document into this one.
| |
MergeDocument(GH_Document, Boolean, Boolean) |
Hoist all objects from another document into this one.
| |
Modified |
Sets the modified flag of this document.
| |
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.
| |
NewSolution(Boolean) |
Start a new solution.
| |
NewSolution(Boolean, GH_SolutionMode) |
Start a new solution.
| |
NonBlankFilter |
This delegate can be used in the FindAllDownstreamObjects(...) methods. Only includes objects that are non-blank and non-failed.
| |
NullFilter |
This delegate can be used in the FindAllDownstreamObjects(...) methods. Includes all objects.
| |
OnContextChanged |
Raise the ContextChanged event.
| |
OnEnabledChanged |
Raise the EnabledChanged event.
| |
OnFilePathChanged |
Raise the FilePathChanged event.
| |
OnModifiedChanged |
Raise the ModifiedChanged event
| |
OnObjectAdded |
Raise the ObjectsAdded event.
| |
OnObjectDeleted |
Raise the ObjectsDeleted event.
| |
OnObjectsAdded |
Raise the ObjectsAdded event.
| |
OnObjectsDeleted |
Raise the ObjectsDeleted event.
| |
OnSettingsChanged |
Raise the SettingsChanged event.
| |
OnUndoStateChanged |
Raise the UndoStateChanged event.
| |
PreviewCurrentMeshParameters |
Gets the currently relevant meshing parameters (do not modify the instance as it may be shared).
| |
Read |
Standard archiving function. Will deserialize the entire document.
| |
Redo |
Perform the first redo event.
| |
RelevantObjectAtPoint(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.
| |
RelevantObjectAtPoint(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.
| |
RemoveObject(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.
| |
RemoveObject(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.
| |
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.
| |
RemoveSelection |
Delete all the objects in the selection set.
This method does not record an Undo event, that is the responsibility of the caller.
| |
RepairProxySources |
Attempts to resolve all proxy sources in the document.
| |
ReplaceProxySources |
Replace all remaining proxy sources in the document with UnresolvedProxy Objects.
| |
RequestAbortSolution |
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.
| |
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
| |
ScheduleSolution(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.
| |
ScheduleSolution(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.
| |
Select(GH_RelevantObjectData) |
Default pick selection behaviour. (looks at current Shift + Control modifier states to determine addition/removal)
| |
Select(GH_RelevantObjectData, Boolean, Boolean) |
Default pick selection behaviour
| |
SelectAll |
Select all top-level attributes.
| |
SelectedObjects |
Returns all selected objects in the document
| |
SetEnabledFlags(Boolean) |
Set the enabled flags of all selected objects to true or false
| |
SetEnabledFlags(ListIGH_DocumentObject, Boolean) |
Set the enabled flags of all specified objects to true or false
| |
SetPreviewFlags(Boolean) |
Set the preview flags of all selected objects to true or false
| |
SetPreviewFlags(ListIGH_DocumentObject, Boolean) |
Set the preview flags of all specified objects to true or false
| |
SetStatusBarEventHelper | ||
ShowPreviewSettings |
Display the Preview settings dialog.
| |
SolutionProgress |
Returns the progress of the current solution.
| |
ToggleEnabledFlags |
Toggle the enabled flags of all selected objects
| |
ToggleEnabledFlags(ListIGH_DocumentObject) |
Toggle the enabled flags of all specified objects
| |
TogglePreviewFlags |
Toggle the preview flags of all selected objects
| |
TogglePreviewFlags(ListIGH_DocumentObject) |
Toggle the preview flags of all specified objects
| |
ToString |
A document serializes itself using the filename of the current path.
This is useful for sorting purposes and ListBoxes.
(Overrides ObjectToString.) | |
TranslateObjects |
Offset objects by a certain distance in X and Y
| |
Undo |
Perform the first undo event.
| |
UnselectedObjects |
Returns all unselected objects in the document
| |
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.
| |
Write(GH_IWriter) |
Standard archiving function. Will serialize the entire document.
| |
Write(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.
|
Name | Description | |
---|---|---|
ContextChanged |
The context for this document was changed.
| |
DefaultPreviewColourChanged |
This even is raised whenever the global default for Normal preview colour is changed.
| |
DefaultSelectedPreviewColourChanged |
This even is raised whenever the global default for Selected preview colour is changed.
| |
EnabledChanged |
The Enabled state was changed on this document.
| |
EnableSolutionsChanged |
Raised whenever the Shared EnabledSolutions property is changed.
| |
FilePathChanged |
Raised whenever the FilePath of the document is modified.
| |
ModifiedChanged |
The modified flag on the document was changed.
| |
ObjectsAdded |
Raised after a collection of objects was added to the document.
| |
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.
| |
SettingsChanged |
Some settings of the document were changed.
| |
SolutionEnd |
This event is raised whenever a new solution request has been handled.
Even if the document is locked.
| |
SolutionStart |
This event is raised whenever a new solution is requested.
Even if the document is locked.
| |
UndoStateChanged |
Raised whenever there is a change to the document undo/redo stack.
|
Name | Description | |
---|---|---|
IgnoredUnknowns |
A collection of missing component IDs to ignore during file load operations.
Erase this cache to re-enable all the load warnings.
| |
ScheduleInactive |
Defined the delay used to indicate the absence of a schedule.
| |
ScheduleRecursive |
Defines the delay used to indicate the schedule should be immedate and recursive.
|