Standard implementation of IGH_DocumentObject.

Constructors

GH_DocumentObject

#
protected GH_DocumentObject()

GH_DocumentObject

#
protected GH_DocumentObject(
name,
nickName,
description,
category,
subCategory
)

GH_DocumentObject

#
[EditorBrowsable(EditorBrowsableState.Never)] protected GH_DocumentObject(
name,
nickname,
description,
category
)

Fields

m_attributes

#
protected IGH_Attributes m_attributes

Properties

Attributes

#
Gets or sets the attributes that are associated with this object. Only set custom attributes if you know what you are doing.
public IGH_Attributes Attributes { get; set; }
Attributes

Category

Gets or sets the Category in which this object belongs. If HasCategory() returns false, this field has no meaning.
public virtual string Category { get; set; }
inherited fromGH_InstanceDescription
Category

ComponentGuid

#
Returns a consistent ID for this object type. Every object must supply a unique and unchanging ID that is used to identify objects of the same type.
public abstract Guid ComponentGuid { get; }
ComponentGuid

Description

Gets or sets the description of the object. This field typically remains fixed during the lifetime of an object.
public virtual string Description { get; set; }
inherited fromGH_InstanceDescription
Description

Exposure

#
Gets the exposure of this object in the Graphical User Interface. The default is to expose everywhere.
public virtual GH_Exposure Exposure { get; }
Exposure

HasCategory

Gets whether or not the Category field has been set.
public bool HasCategory { get; }
inherited fromGH_InstanceDescription
HasCategory

HasSubCategory

Gets whether or not the SubCategory field has been set.
public bool HasSubCategory { get; }
inherited fromGH_InstanceDescription
HasSubCategory

Icon

#
Override this function to supply a custom icon (24x24 pixels). The result of this property is cached, so don't worry if icon retrieval is not very fast.
protected virtual Bitmap Icon { get; }

Icon_24x24

#
The icon associated with this object.
public Bitmap Icon_24x24 { get; }
Icon_24x24

Icon_24x24_Locked

#
The greyscale icon of this object.
public Bitmap Icon_24x24_Locked { get; }
Icon_24x24_Locked

IconDisplayMode

#
Gets the current display mode of the object.
public GH_IconDisplayMode IconDisplayMode { get; set; }
IconDisplayMode

InstanceDescription

Gets a description of the current state of the object. This field is usually the same as the Description() field, but it might be variable when overridden.
public virtual string InstanceDescription { get; }
inherited fromGH_InstanceDescription

InstanceGuid

Gets the ID of this runtime instance.
public Guid InstanceGuid { get; }
inherited fromGH_InstanceDescription
InstanceGuid

Internal_Icon_24x24

#
Override this function to supply a custom icon. The result of this property is cached, so don't worry if icon retrieval is not very fast.
[EditorBrowsable(EditorBrowsableState.Never)] [Browsable(false)] protected virtual Bitmap Internal_Icon_24x24 { get; }

Keywords

Gets a list of additional keywords that describe the object. Typically this list is empty but you can override this property to aid in object searches.
public virtual IEnumerable<string> Keywords { get; }
inherited fromGH_InstanceDescription
Keywords

Name

Gets or sets the name of the object. This field typically remains fixed during the lifetime of an object.
public virtual string Name { get; set; }
inherited fromGH_InstanceDescription
Name

NickName

Gets or sets the nickname of the object. This field can be changed by the user.
public virtual string NickName { get; set; }
inherited fromGH_InstanceDescription
NickName

Obsolete

#
Gets whether this object is obsolete. Default implementation returns true if the class name contains the string "OBSOLETE" or if this class has been decorated with the ObsoleteAttribute. You are free to override this if you want, but I suggest adding the ObsoleteAttribute instead.
public virtual bool Obsolete { get; }
Obsolete

SubCategory

Gets or sets the SubCategory in which this object belongs. If HasSubCategory() returns false, this field has no meaning.
public virtual string SubCategory { get; set; }
inherited fromGH_InstanceDescription
SubCategory

Methods

AddedToDocument

#
This method will be called when an object is added to a document. Override this method if you want to handle such events.
public virtual void AddedToDocument(
document
Document that now owns this object.
)
AddedToDocument

AppendMenuItems

#
This function is called when a context menu is about to be displayed. Override it to set custom items.
public virtual bool AppendMenuItems(
menu
Menu object to populate.
)
If true, the menu will be displayed, if false the menu will be supressed.
AppendMenuItems

ConnectNewObject

#
protected internal static bool ConnectNewObject()

CopyFrom

Copy all fields (except the instance ID) from another instance description.
public void CopyFrom(
other
Object to mimic.
)
inherited fromGH_InstanceDescription

CreateAttributes

#
This function creates the stand-alone attributes for this object. If you wish to supply your own Attributes, you must override this function.
public abstract void CreateAttributes()
CreateAttributes

DestroyIconCache

#
Call this method to erase the existing icon cache. You must call this if you want to change the display icon of an object.
protected void DestroyIconCache()

DocumentContextChanged

#
This method will be called when the document that owns this object moves into a different context.
public virtual void DocumentContextChanged(
document,
Document that owns this object.
context
The reason for this event.
)

ExpirePreview

#
Call this function when you suspect that the preview has expired for this object. This will cause the display cache to be eradicated.
public virtual void ExpirePreview(
redraw
)
ExpirePreview

ExpireSolution

#
Call this function whenever you do something which expires the current solution. This will make sure all caches are erased, all downstream objects are expired and that the event is raised. The default implementation merely places a call to OnSolutionExpired(), override this function in derived classes to make sure you clear local data caches and expire downstream objects.
public virtual void ExpireSolution(
recompute
If True, the solution will be recomputed straight away.
)
ExpireSolution

GetValue

#
Get a boolean value from the component value table.
protected bool GetValue(
valueName,
Name of boolean to retrieve.
default
Default value to return in case of missing named value.
)
The boolean value with the given name of the default value.

GetValue

#
Get a color value from the component value table.
protected Color GetValue(
valueName,
Name of color to retrieve.
Color
default
Default value to return in case of missing named value.
)
The color value with the given name of the default value.

GetValue

#
Get a double value from the component value table.
protected double GetValue(
valueName,
Name of double to retrieve.
default
Default value to return in case of missing named value.
)
The double value with the given name of the default value.

GetValue

#
Get an integer value from the component value table.
protected int GetValue(
valueName,
Name of integer to retrieve.
default
Default value to return in case of missing named value.
)
The integer value with the given name of the default value.

GetValue

#
Get a string value from the component value table.
protected string GetValue(
valueName,
Name of string to retrieve.
default
Default value to return in case of missing named value.
)
The string value with the given name of the default value.

HtmlHelp_Source

#
Return a String which contains HTML formatted source for the help topic. If you want to pass a URL that points to a remote page, then prefix the URL with a GOTO: tag, like so: GOTO:http://www.YourWebAddressHere.com
protected internal virtual string HtmlHelp_Source()
Remarks: You can use the GUI.GH_HtmlFormatter class to generate an HTML page which conforms to Grasshopper Help standards

IsolateObject

#
Destroy all connections to other objects.
public virtual void IsolateObject()
IsolateObject

MovedBetweenDocuments

#
This method will be called when an object is moved from one document to another. Override this method if you want to handle such events.
public virtual void MovedBetweenDocuments(
oldDocument,
Document that used to own this object.
newDocument
Document that now owns ths object.
)

NewInstanceGuid

Generate a new random instance GUID
public void NewInstanceGuid()
inherited fromGH_InstanceDescription
NewInstanceGuid

NewInstanceGuid

Set the instance ID to be a specific GUID. This is very dangerous, only use this function if you're 6"4' and your first name is David.
public void NewInstanceGuid(
UUID
)
inherited fromGH_InstanceDescription
NewInstanceGuid

OnAttributesChanged

#
Raises the AttributesChanged event on the toplevel object.
public void OnAttributesChanged()

OnDisplayExpired

#
Raises the DisplayExpired event on the toplevel object.
public void OnDisplayExpired(
redraw
If True, the canvas will be immediately redrawn.
)
OnDisplayExpired

OnObjectChanged

#
public void OnObjectChanged()
OnObjectChanged

OnObjectChanged

#
public void OnObjectChanged()
OnObjectChanged

OnObjectChanged

#
public void OnObjectChanged()
OnObjectChanged

OnObjectChanged

#
public void OnObjectChanged(
customEvent,
tag
)
OnObjectChanged

OnObjectChanged

#
public void OnObjectChanged(
customEvent
)
OnObjectChanged

OnPingDocument

#
Raise the PingDocument Event on the toplevel object and try to find the document which owns this object.
public GH_Document OnPingDocument()
The document which owns this object if successful, or nothing if no document owns this object.
OnPingDocument

OnPreviewExpired

#
Raises the PreviewExpired event on the toplevel object.
public void OnPreviewExpired(
redraw
If True, the viewports will be immediately redrawn.
)
OnPreviewExpired

OnSolutionExpired

#
Raises the SolutionExpired event on the toplevel object. You probably want to call ExpireSolution() instead of this method directly.
public void OnSolutionExpired(
recompute
If True, the solution will be immediately recalculated.
)
OnSolutionExpired

Read

#
public override bool Read(
reader
)

ReadFull

GH_InstanceDescription does not by default serialize all fields. Use this function to read all fields from the archive. This method is compatible with the default Write()/Read() operations.
public virtual bool ReadFull(
reader
Writer for deserialization.
)
inherited fromGH_InstanceDescription
True on success, false on failure.

RecordUndoEvent

#
Record a specific object change undo event.
public Guid RecordUndoEvent(
undoName,
Name of undo record.
action
Undo action to record.
)
The ID of the newly added record or Guid.Empty on failure.
RecordUndoEvent

RecordUndoEvent

#
Record a generic object change undo event.
public Guid RecordUndoEvent(
undoName
Name of undo record.
)
The ID of the newly added record or Guid.Empty on failure.
RecordUndoEvent

RecordUndoEvent

#
Record an entire undo record.
public void RecordUndoEvent(
record
Record to push.
)
RecordUndoEvent

RemovedFromDocument

#
This method will be called when an object is removed from a document. Override this method if you want to handle such events.
public virtual void RemovedFromDocument(
document
Document that now no longer owns this object.
)

SetIconOverride

#
Set a new custom icon override for this object.
public void SetIconOverride(
Bitmap
customIcon
Icon override. Should be a 24x24 image.
)

SetValue

#
Set a named value. This value will be serialized with the component.
protected void SetValue(
valueName,
Name of value.
value
Value itself.
)

SetValue

#
Set a named value. This value will be serialized with the component.
protected void SetValue(
valueName,
Name of value.
Color
value
Value itself.
)

SetValue

#
Set a named value. This value will be serialized with the component.
protected void SetValue(
valueName,
Name of value.
value
Value itself.
)

SetValue

#
Set a named value. This value will be serialized with the component.
protected void SetValue(
valueName,
Name of value.
value
Value itself.
)

SetValue

#
Set a named value. This value will be serialized with the component.
protected void SetValue(
valueName,
Name of value.
value
Value itself.
)

TriggerAutoSave

#
Triggers the AutoSave function on the owner document with the object_changed flag.
public void TriggerAutoSave()
TriggerAutoSave

TriggerAutoSave

#
Triggers the AutoSave function on the owner document with a custom flag.
public void TriggerAutoSave(
trigger,
Reason for the autosave operation. It is possible that a user has decided to avoid autosave events for specific types, so if you can, try and provide a correct trigger flag.
id
ID of autosave event. Consecutive autosave requests with the same ID will be ignored.
)
TriggerAutoSave

TriggerAutoSave

#
Triggers the AutoSave function on the owner document with a custom flag.
public void TriggerAutoSave(
trigger
Reason for the autosave operation. It is possible that a user has decided to avoid autosave events for specific types, so if you can, try and provide a correct trigger flag.
)
TriggerAutoSave

TriggerAutoSave

#
Triggers the AutoSave function on the owner document with the object_changed flag.
public void TriggerAutoSave(
id
ID of autosave event. Consecutive autosave requests with the same ID will be ignored.
)
TriggerAutoSave

ValuesChanged

#
Override this method if you want to respond to changes to the value table. The base implementation is empty, so you don't have to call it.
protected virtual void ValuesChanged()

Write

#
public override bool Write(
writer
)

WriteFull

GH_InstanceDescription does not by default serialize all fields. Use this function to write all fields to the archive. This method is compatible with the default Write()/Read() operations.
public virtual bool WriteFull(
writer
Writer for serialization.
)
inherited fromGH_InstanceDescription
True on success, false on failure.

Events

AttributesChanged

#
Raised whenever the number or kind of attributes changes. This event is handled by GH_Documents who subsequently wipe their attribute caches.
public event IGH_DocumentObject.AttributesChangedEventHandler AttributesChanged
AttributesChanged

DisplayExpired

#
Raised whenever the display (on the Canvas) of a certain object becomes invalid.
DisplayExpired

ObjectChanged

#
ObjectChanged

PingDocument

#
Raised whenever an object needs to know which GH_Document it belongs to.
PingDocument

PreviewExpired

#
Raised whenever the display (in the Rhino viewports) of a certain object becomes invalid.
PreviewExpired

SolutionExpired

#
Raised whenever the solution of a certain object becomes invalid.
public event IGH_DocumentObject.SolutionExpiredEventHandler SolutionExpired
SolutionExpired