GH_Document
References[DebuggerDisplay("{DisplayName}")]
public sealed class GH_Document : GH_ISerializable, IDisposable, IComparable<GH_Document>, IGH_DebugDescription
Represents a single Grasshopper document.
Constructors
GH_Document
#public GH_Document()
Constructor for GH_Document. Makes sure all important members are initialized.
Fields
Properties
ActiveDoc
#Gets or sets a value indicating that this document was last active in a multi-doc aware Rhino.
Value:
true if this was the last active document; otherwise, false.Attributes
#Returns a list of all the attributes in this document. This includes attributes for nested objects such as input or output parameters.
Remarks: If the attribute cache is empty, it will be rebuild. Hence, this could be quite an expensive call to make.
ContainsCustomRenderObjects
#Gets whether this document contains custom preview objects which are both ENABLED and included in RENDERING.
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.
CustomRenderObjects
#[EditorBrowsable(EditorBrowsableState.Never)]
public IEnumerable<GH_CustomPreviewComponent> CustomRenderObjects { get; }
Enumerate over all enabled, rendering, non-empty custom preview objects.
DefaultPreviewColour
#public static Color DefaultPreviewColour { get; set; }
Gets or sets the default preview colour for normal objects.
DefaultSelectedPreviewColour
#public static Color DefaultSelectedPreviewColour { get; set; }
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.
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.
Returns: 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.
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.
PreviewColour
#public Color PreviewColour { get; set; }
Gets or sets the colour of unselected preview geometry.
PreviewColourSelected
#public Color PreviewColourSelected { get; set; }
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
PreviewMode
#Gets or sets the preview display mode and makes sure the conduit instance of this class is set to match.
RaiseEvents
#If RaiseEvents is set to false, all the On....() methods of this document will stop raising events.
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.
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.
UndoUtil
#Gets a temporary undo utility instance that allows you to easily create standard undo events.
Returns: 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.
Methods
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
Parameters:
| docObject (IGH_DocumentObject) | The object to add. |
| update (bool) | If True, a new solution will be triggered afterwards, regardless of event response settings. |
| index (int = 2147483647) | Index at which object will be inserted. |
AlignObjects
#Perform alignment and distribution logic on a set of objects.
Parameters:
| align (GH_Align) | |
| distribute (GH_Distribute) | |
| objs (List<IGH_DocumentObject>) |
AlignObjects
#Perform alignment and distribution logic on all selected objects.
Parameters:
| align (GH_Align) | |
| distribute (GH_Distribute) |
AppendToDebugLog
#Useful for creating textual representations of this document for debugging purposes.
Parameters:
| writer (GH_DebugDescriptionWriter) |
Implements: AppendToDebugLog
ArrangeObject
#Rearrange the stack order of the object.
Parameters:
| obj (IGH_DocumentObject) | Object to move. |
| motion (GH_Arrange) | Direction to move in. |
ArrangeObjects
#Rearrange the stack order of a collection of objects.
Parameters:
| objs (IEnumerable<IGH_DocumentObject>) | Objects to move. |
| motion (GH_Arrange) | Direction to move in. |
AssociateWithRhinoDocument
#public void 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.
Parameters:
| limitToSelection (bool) | 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.
Parameters:
| trigger (GH_AutoSaveTrigger) | Reason for autosave. User can choose to ignore certain autosave reasons. |
| id (Guid) | 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.
Parameters:
| trigger (GH_AutoSaveTrigger) | Reason for autosave. User can choose to ignore certain autosave reasons. |
AutoSaveFileName
#Computes the autosave filename for a full grasshopper filepath.
Parameters:
| filename (string) | Full path of Grasshopper file, including directories and extension. |
Returns: 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.
Parameters:
| limitToSelection (bool = false) | If true, only selected attributes are included in the boundingbox computation. |
Returns: The boundingbox of the requested objects or RectangleF.Empty if no objects could be found.
BringSelectionToTop
#public void BringSelectionToTop()
Move the selection set to the top of the visible stack
ClearReferenceTable
#public void 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.
Returns: The number of subsidiary documents that was closed.
ClusterInputHooks
#Gets a sorted list of all the cluster input hooks.
Returns: 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.
Parameters:
| id (Guid) | The cluster document id to search for. |
Returns: The number of instances of a specific cluster.
ClusterOutputHooks
#Gets a sorted list of all the cluster output hooks.
Returns: 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.
Parameters:
| other (GH_Document) | Document to compare to. |
Returns: Comparison key.
ConstructDocumentTree
#Create a hierarchical document tree of ownership with this document as the root.
Returns: A tree of all documents owned directly or indirectly by this document.
ConvertFullNamesToNickNames
#public void 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
#public void 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
#public void 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.
Returns: 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.
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.
Parameters:
| name (string) | Name of constant. |
| value (GH_Variant) | Value of constant. |
DestroyAttributeCache
#public void DestroyAttributeCache()
Destroys the Attribute cache. Call this function whenever you do something which might affect attributes.
DestroyAutoSaveFiles
#public void 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
#public void 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.
DestroyPreviewMeshes
#public void 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
#public void DestroyProxySources()
Remove all remaining proxy sources from the document.
Dispose
#public void 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.
Parameters:
| doc (GH_Document) | Document to copy. |
Returns: A document similar to the input on success, or nothing on failure.
FilterActive
#Filter a list of objects.
Parameters:
| in (List<IGH_DocumentObject>) | The object list to filter |
Returns: A list containing only the objects that implement the IGH_ActiveObject interface
FilterDisabled
#Filter a list of objects.
Parameters:
| in (List<IGH_DocumentObject>) | The object list to filter |
Returns: A list containing only the disabled objects
FilterEnabled
#Filter a list of objects.
Parameters:
| in (List<IGH_DocumentObject>) | The object list to filter |
Returns: A list containing only the enabled objects
FilterInactive
#Filter a list of objects.
Parameters:
| in (List<IGH_DocumentObject>) | The object list to filter |
Returns: A list containing only the objects that don't implement the IGH_ActiveObject interface
FilterObjects
#public static List<IGH_DocumentObject> FilterObjects(List<IGH_DocumentObject> in, GH_Filter bSelectedObjects = GH_Filter.DontCare, GH_Filter bEnabledObjects = GH_Filter.DontCare, GH_Filter bActiveObjects = GH_Filter.DontCare)
Filter a list of objects using several filters at once
Parameters:
| in (List<IGH_DocumentObject>) | The set to filter |
| bSelectedObjects (GH_Filter = GH_Filter.DontCare) | Filter (non)selected objects only |
| bEnabledObjects (GH_Filter = GH_Filter.DontCare) | Filter (non)enabled objects only |
| bActiveObjects (GH_Filter = GH_Filter.DontCare) | Filter (non)active objects only |
Returns: A list with all objects that pass all filters
FilterSelected
#Filter a list of objects.
Parameters:
| in (List<IGH_DocumentObject>) | The object list to filter |
Returns: A list containing only the selected objects
FilterUnselected
#Filter a list of objects.
Parameters:
| in (List<IGH_DocumentObject>) | The object list to filter |
Returns: A list containing only the unselected objects
FindAllDownstreamObjects
#public List<IGH_ActiveObject> FindAllDownstreamObjects(IGH_ActiveObject from, GH_ActiveObjectFilter filter)
Find all objects that depend in some way on the Source.
Parameters:
| from (IGH_ActiveObject) | Object to start searching from. |
| filter (GH_Document.GH_ActiveObjectFilter) | The inclusion delegate |
FindAllDownstreamObjects
#Find all objects that depend in some way on the Source.
Parameters:
| from (IGH_ActiveObject) | Object to start searching from. |
FindAllDownstreamObjects
#public List<IGH_ActiveObject> FindAllDownstreamObjects(List<IGH_ActiveObject> from, GH_ActiveObjectFilter filter)
Find all objects that depend in some way on the Source collection
Parameters:
| from (List<IGH_ActiveObject>) | Objects to start searching from. |
| filter (GH_Document.GH_ActiveObjectFilter) | The inclusion delegate |
FindAllDownstreamObjects
#Find all objects that depend in some way on the Source collection
Parameters:
| from (List<IGH_ActiveObject>) | Objects to start searching from. |
FindAttributeByGrip
#public IGH_Attributes FindAttributeByGrip(PointF pt, bool bLimitToOutside, bool bIncludeInputs, bool bIncludeOutputs, int SearchRadius = 12)
Search for attributes that contain grips near the search locus
FindClusters
#Find all the clusters that have a matching ID.
Parameters:
| id (Guid) | Cluster DocumentID to search for. |
Returns: A list of all the clusters that match the ID.
FindClusters
#Find all the clusters that have a matching filepath.
Parameters:
| filepath (string) | Cluster FilePath to search for. |
Returns: A list of all the clusters that match the filepath.
FindComponent
#Search for components using an ID filter
Parameters:
| id (Guid) | ID to search for |
Returns: The component with the ID, or Null if no component could be found
FindComponent
#Search for components that contain the locus
Parameters:
| pt (Point) | The point to search for |
FindFloatingParameter
#Search for floating parameters that contain the locus
Parameters:
| pt (Point) | Point for search start |
FindInputParameter
#Search for input (upstream) parameters that contain the locus
Parameters:
| pt (Point) | Point for search start |
FindObject<T>
#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
Parameters:
| pt (Point) | Point for search start |
FindParameter
#Search for parameters using an ID filter
Parameters:
| id (Guid) | ID to search for |
Returns: The parameter with the ID, or Null if no parameter could be found
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.
Parameters:
| previewOn (bool) |
GetAllInstanceIDs
#Get a sorted list of all the IGH_DocumentObject instance IDs in this document.
Parameters:
| topLevelOnly (bool) | If true, only top level objects are considered. |
Returns: 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
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.
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.
Returns: True if escape was/is pressed, false if otherwise.
IsRenderMeshPipelineViewport
#Test to see whether a pipeline should have custom render meshes vs. previews.
Parameters:
| pipeline (DisplayPipeline) | Display pipeline. |
Returns: True if custom meshes ought to be used rather than previews.
MergeDocument
#Hoist all objects from another document into this one.
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.
Parameters:
| other (GH_Document) | The other document. Cannot be null. |
| resolveProxies (bool) | If True, an attempt is made to repair proxy sources after insertion. |
| removeProxies (bool) | If True, all remaining proxies will be deleted. |
MergeDocument
#Hoist all objects from another document into this one.
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.
Parameters:
| other (GH_Document) | The other document. Cannot be Null or |
| resolveProxies (bool) | If True, an attempt is made to repair proxy sources after insertion. |
MergeDocument
#Hoist all objects from another document into this one.
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.
Parameters:
| other (GH_Document) | The other document. Cannot be Null or |
MutateAllIds
#public void 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
#Start a new solution.
Parameters:
| expireAllObjects (bool) | If True, all objects will be recalculated. If False, only already expired objects will be recalculated. |
| mode (GH_SolutionMode) | Solution mode. Only use CommandLine or Silent if your solution runs in the background. |
NewSolution
#Start a new solution.
Parameters:
| expireAllObjects (bool) | 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.
Parameters:
| iObj (IGH_ActiveObject) |
NullFilter
#This delegate can be used in the FindAllDownstreamObjects(...) methods. Includes all objects.
Parameters:
| iObj (IGH_ActiveObject) |
OnFilePathChanged
#Raise the FilePathChanged event.
OnObjectAdded
#Raise the ObjectsAdded event.
Parameters:
| doc_object (IGH_DocumentObject) | Object that was added. |
OnObjectDeleted
#Raise the ObjectsDeleted event.
Parameters:
| doc_object (IGH_DocumentObject) | Object that was deleted. |
OnObjectsAdded
#Raise the ObjectsAdded event.
Parameters:
| doc_objects (IEnumerable<IGH_DocumentObject>) | Objects that were added. |
OnObjectsDeleted
#Raise the ObjectsDeleted event.
Parameters:
| doc_objects (IEnumerable<IGH_DocumentObject>) | Objects that were deleted. |
OnUndoStateChanged
#Raise the UndoStateChanged event.
Parameters:
| op (GH_UndoOperation) | Type of undo operation to provide with the Event arguments. |
| rec (GH_UndoRecord) | Record to provide in the Event arguments. |
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.
Parameters:
| reader (GH_IReader) |
Implements: Read
Redo
#Perform the first redo event.
Returns: 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.
Parameters:
| pt (PointF) | The point to test. |
| searchFilter (GH_RelevantObjectFilter) |
Returns: 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.
Parameters:
| pt (PointF) | The point to test. |
Returns: 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.
Parameters:
| attribute (IGH_Attributes) | |
| update (bool) |
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.
Parameters:
| docObject (IGH_DocumentObject) | Object to remove. |
| update (bool) |
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.
Parameters:
| objectList (IEnumerable<IGH_DocumentObject>) | Objects to remove from this document. |
| update (bool) | If True, the solution will be recomputed. |
Returns: 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.
Parameters:
| update (bool) | If True, the solution will be recomputed. |
RepairProxySources
#Attempts to resolve all proxy sources in the document.
Returns: False if one or more proxies could not be resolved
ReplaceProxySources
#public void ReplaceProxySources()
Replace all remaining proxy sources in the document with UnresolvedProxy Objects.
RequestAbortSolution
#public void 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.
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
Returns: 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.
Parameters:
| delay (int) | 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 (GH_Document.GH_ScheduleDelegate) | 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.
Parameters:
| delay (int) | 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
Parameters:
| obj_dat (GH_RelevantObjectData) | Information regarding the object to be selected. |
| bAdd (bool) | 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 (bool) | 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)
Parameters:
| obj_dat (GH_RelevantObjectData) | Information regarding the object to be selected. |
SetEnabledFlags
#Set the enabled flags of all selected objects to true or false
Parameters:
| bEnable (bool) |
SetEnabledFlags
#Set the enabled flags of all specified objects to true or false
Parameters:
| objects (List<IGH_DocumentObject>) | |
| bEnable (bool) |
SetPreviewFlags
#Set the preview flags of all selected objects to true or false
Parameters:
| bPreview (bool) |
SetPreviewFlags
#Set the preview flags of all specified objects to true or false
Parameters:
| objects (List<IGH_DocumentObject>) | |
| bPreview (bool) |
SolutionProgress
#Returns the progress of the current solution.
ToggleEnabledFlags
#Toggle the enabled flags of all specified objects
Parameters:
| objects (List<IGH_DocumentObject>) |
TogglePreviewFlags
#Toggle the preview flags of all specified objects
Parameters:
| objects (List<IGH_DocumentObject>) |
ToString
#A document serializes itself using the filename of the current path. This is useful for sorting purposes and ListBoxes.
Overrides: Object.ToString
Undo
#Perform the first undo event.
Returns: True on success, false on no undo event or invalid undo event.
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.
Returns: 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.
Parameters:
| writer (GH_IWriter) | Writer to serialize with. |
| objList (IList<IGH_DocumentObject>) | Object list override |
Write
#Standard archiving function. Will serialize the entire document.
Parameters:
| writer (GH_IWriter) |
Implements: Write
Events
DefaultPreviewColourChanged
#This even is raised whenever the global default for Normal preview colour is changed.
DefaultSelectedPreviewColourChanged
#public static event GH_Document.DefaultSelectedPreviewColourChangedEventHandler DefaultSelectedPreviewColourChanged
This even is raised whenever the global default for Selected preview colour is changed.
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.
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.