IDocumentObject

References
public interface IDocumentObject : IStorable
Defines the rules and regulations for any object that wishes to be part of an IDocument.

Properties

Activity

#
Gets or sets the active state of this object. Note that this property is meaningless for certain types of object.
ObjectActivity Activity { get; set; }

Attributes

#
Gets or sets the attributes for this object. It is possible that an object does not have attibutes. Only objects that are drawn on the canvas are guaranteed to have attributes.
IAttributes Attributes { get; }

ChildrenObjects

#
Gets all immediate child objects that belong to the current object. It is possible that an object does not have any children, and it is possible that a child object has children of its own.
IEnumerable<IDocumentObject> ChildrenObjects { get; }

Connectivity

#
Gets the topological description of this object. The topology is not updated automatically, so be sure to get a fresh instance every time you need it.
IObjectConnectivity Connectivity { get; }

CustomValues

#
Gets a collection of keyed values which can be used to store custom data which will survive (de)serialisation.
KeyedValues CustomValues { get; }

Display

#
Gets or sets the display state of this object. Note that this property is meaningless for certain types of object.
ObjectDisplay Display { get; set; }

DisplayCapable

#
Gets whether this object makes allowance for 3D viewport displays.
bool DisplayCapable { get; }

DisplayName

#
Gets the display name of this object. Often the DisplayName is identical to the UserName, but there could be more complicated algorithms involved.
string DisplayName { get; }

DisplayStyle

#
Gets or sets the display style to use for the geometric data inside this object. Note that this property is meaningless for certain types of object.
ObjectDisplayStyle DisplayStyle { get; set; }

Document

#
Gets the document this object belongs to. It is possible an object does not belong to any document. Do not assign or remove document associations unless you know exactly what you are doing.
Document Document { get; set; }

EntireFamily

#
Enumerates over all objects in the hierarchy this object is part of. This enumeration starts at the root object and then continues over all children and grandchildren in a breadth-first fashion.
IEnumerable<IDocumentObject> EntireFamily { get; }

FoundingObject

#
Gets the root or founding object in the object hierarchy. If the current object does not have a parent, it is a founding object.
IDocumentObject FoundingObject { get; }

Icon

#
Gets the icon associated with this object.
IIcon Icon { get; }

InstanceId

#
Gets or sets the instance Id for this object. The instance Id should be different for every instance of every type. Do *not* assign this Id unless you know exactly what you are doing.
Guid InstanceId { get; set; }

Nomen

#
Gets the user friendly description of this object.
Nomen Nomen { get; }

Obsolete

#
Gets whether this object is considered obsolete.
bool Obsolete { get; }

ParentObject

#
Gets or sets the parent object that owns this object. Top-level objects do not have parents. Do not assign or remove parents unless you know exactly what you are doing.
IDocumentObject ParentObject { get; set; }

Phase

#
Gets the current solution phase of this object.
Phase Phase { get; }

ProgressPercentage

#
Gets an object progress percentage while the object is computing. The Grasshopper UI may or may not choose to display this percentage somewhere.
int ProgressPercentage { get; }

Relevance

#
Gets or sets the auxiliary state of this object. Auxiliary objects are drawn in an inconspicuous way as they are considered in-between logic. Note that this property is meaningless for certain types of object.
ObjectRelevance Relevance { get; set; }

Selected

#
Gets the main yes/no state from the SelectionState.
bool Selected { get; }

Selection

#
Gets or sets the selected state of this object. Note that the selected setting of secondary objects is inherited from the parent.
ObjectSelection Selection { get; set; }

SiblingObjects

#
Gets all sibling objects in the object family tree.
IEnumerable<IDocumentObject> SiblingObjects { get; }

State

#
Gets the current solution state of this object.
ObjectSolutionState State { get; }

UserName

#
Gets the user specified name of this object.
string UserName { get; set; }

Methods

AddUndoRecord

#
Add a custom undo record for this object.
void AddUndoRecord(
Record
record
Undo record to add.
)
Id of undo record.

AddUndoRecord

#
Add a single action undo record for this object.
void AddUndoRecord(
name,
Name of undo record.
action
Specific action to undo.
)
Id of undo record.

AppendToInputPanel

#
Append the object specific items to an existing input panel.
void AppendToInputPanel()

Compute

#
Compute a new solution for this object, or return a completed solution if one is available.
SolutionData Compute(
solution,
Document solution info.
stack
Call stack leading up to this call.
)
Result of computation.

DisplayBounds

#
Gets the bounds of the geometry this object might display.
BoundingBox DisplayBounds()

DisplayFaces

#
Draw the shaded faces for this object.
void DisplayFaces(
pipeline,
guises,
extents
)

DisplayWires

#
Draw the wires for this object.
void DisplayWires(
pipeline,
guises,
extents
)

Expire

#
Expire this object and all objects that depend on it. This will request-cancel any running solutions inside whatever document contains this object.
void Expire()

GetCreationInfo

#
Gets information about who created this component and when.
bool GetCreationInfo(
out string
userName,
Name of creator.
time
Time of creation in UTC coordinates.
)
True if the creation data was available.

GetModificationInfo

#
Gets information about who last modified this component and when.
bool GetModificationInfo(
out string
userName,
Name of modifier.
time
Time of modification in UTC coordinates.
)
True if the modification data was available.

ModifyIcon

#
Override the icon for this object. Use this judiciously.
void ModifyIcon(
newIcon,
New icon to assign, or null to revert to the default icon.
overrideExtrinsicIcon = true
If true, the permanent extrinsic icon will be overwritten. If false, the temporary intrinsic icon will be overwritten.
)

ModifyNameAndInfo

#
Programmatically modify the nickname, name and/or info strings on the Nomen.
void ModifyNameAndInfo(
name = null,
New name if not null.
info = null
New info if not null.
)

OnDisplayChanged

#
Raise the DisplayChanged event.
void OnDisplayChanged()

OnLayoutChanged

#
Raise the LayoutChanged event.
void OnLayoutChanged()

OverrideAttributes

#
Assign new attributes to this object. Not all attributes may be accepted, it depends on the implementation.
bool OverrideAttributes(
attributes
New attributes to assign. Assigning null will revert to default attributes.
)
True if attributes were accepted.

RequestAutoSave

#
Request an autosave.
AutoSaveResult RequestAutoSave(
reason,
Autosave reason.
autosaveId
Autosave Id. Consecutive requests with identical Ids are ignored.
)

RequestAutoSave

#
Request an autosave using the instance ID of this object as a filter. This means hat subsequent autosave requests coming from the same object will be ignored.
AutoSaveResult RequestAutoSave()

SetCreationInfo

#
Set the CreatedBy and CreatedAt fields if they haven't been set already.
void SetCreationInfo()

SetModificationInfo

#
Set the ModifiedBy and ModifiedAt fields.
void SetModificationInfo()

Store

This method is called whenever the instance is required to serialize itself.
void Store(
writer
Writer object to serialize with.
)
inherited fromIStorable

UpdateDisplay

#
Recreate the display caches based on the given solution data and display rules.
void UpdateDisplay(
data,
Data from which to extract display caches.
rules,
Optional display rules.
token
Cancellation token.
)

Events

ActivityChanged

#
Raised whenever the Enabled state of this object changes.
event EventHandler<ObjectEventArgs> ActivityChanged

AutosaveRequested

#
Raised whenever this object requests an autosave.
event EventHandler<ObjectAutoSaveEventArgs> AutosaveRequested

DisplayChanged

#
Raised whenever the display state of this object changes.
event EventHandler<ObjectEventArgs> DisplayChanged

DocumentChanged

#
Raised whenever this object becomes part of a different document.
event EventHandler<ObjectDocumentEventArgs> DocumentChanged

Expired

#
Raised whenever the solution currently held by this object is expired.

InstanceIdChanged

#
Raised whenever the InstanceId of this object changes.
event EventHandler<ObjectGuidEventArgs> InstanceIdChanged

LayoutChanged

#
Raised whenever the layout of this object changes. Layout invalidation triggers a canvas redraw.
event EventHandler<ObjectEventArgs> LayoutChanged

NameChanged

#
Raised whenever the UserName of this object changes. This typically infers that the DisplayName also changes.

RelevanceChanged

#
Raised whenever the Auxiliary state of this object changes.
event EventHandler<ObjectEventArgs> RelevanceChanged

SelectedChanged

#
Raised whenever the Selected state of this object changes.
event EventHandler<ObjectEventArgs> SelectedChanged