Click or drag to resize

GH_ActiveObject Class

Basic implementation of IGH_ActiveObject interface. Derive from this class rather than implementing IGH_ActiveObject to make your life easier.
Inheritance Hierarchy

Namespace:  Grasshopper.Kernel
Assembly:  Grasshopper (in Grasshopper.dll)
Syntax
public abstract class GH_ActiveObject : GH_DocumentObject, 
	IGH_ActiveObject

The GH_ActiveObject type exposes the following members.

Constructors
  NameDescription
Protected methodGH_ActiveObject(IGH_InstanceDescription)
Initializes a new instance of the GH_ActiveObject class
Protected methodGH_ActiveObject(String, String, String, String, String)
Initializes a new instance of the GH_ActiveObject class
Top
Properties
  NameDescription
Public propertyAttributes
Gets or sets the attributes that are associated with this object. Only set custom attributes if you know what you are doing.
(Inherited from GH_DocumentObject.)
Public propertyCategory
Gets or sets the Category in which this object belongs. If HasCategory() returns false, this field has no meaning.
(Inherited from GH_InstanceDescription.)
Public propertyComponentGuid
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.
(Inherited from GH_DocumentObject.)
Public propertyDescription
Gets or sets the description of the object. This field typically remains fixed during the lifetime of an object.
(Inherited from GH_InstanceDescription.)
Public propertyExposure
Gets the exposure of this object in the Graphical User Interface. The default is to expose everywhere.
(Inherited from GH_DocumentObject.)
Public propertyHasCategory
Gets whether or not the Category field has been set.
(Inherited from GH_InstanceDescription.)
Public propertyHasSubCategory
Gets whether or not the SubCategory field has been set.
(Inherited from GH_InstanceDescription.)
Protected propertyIcon
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.
(Inherited from GH_DocumentObject.)
Public propertyIcon_24x24
The icon associated with this object.
(Inherited from GH_DocumentObject.)
Public propertyIcon_24x24_Locked
The greyscale icon of this object.
(Inherited from GH_DocumentObject.)
Public propertyIconCapableUI
By default the NickName menu item supports the Icon Mode override toggle. If your UI is not capable of displaying icons, then override this property and return False.
Public propertyIconDisplayMode
Gets the current display mode of the object.
(Inherited from GH_DocumentObject.)
Public propertyInstanceDescription
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.
(Inherited from GH_InstanceDescription.)
Public propertyInstanceGuid
Gets the ID of this runtime instance.
(Inherited from GH_InstanceDescription.)
Public propertyIsDataProvider
Returns a boolean indicating whether or not the current object can seed data.
Public propertyKeywords
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.
(Inherited from GH_InstanceDescription.)
Public propertyLocked
Gets or sets the enabled flag of this object. Disabled objects are ignored during solutions.
Public propertyMutableNickName
Gets or sets a value that enables Nick name changes through the menu. The default is TRUE.
Public propertyName
Gets or sets the name of the object. This field typically remains fixed during the lifetime of an object.
(Inherited from GH_InstanceDescription.)
Public propertyNickName
Gets or sets the nickname of the object. This field can be changed by the user.
(Inherited from GH_InstanceDescription.)
Public propertyObsolete
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.
(Inherited from GH_DocumentObject.)
Public propertyPhase
Gets or sets the solution phase this object is currenly in.
Public propertyProcessorTime
Gets the most recent processor time profiler value.
Public propertyRuntimeMessageLevel
Returns the worst case flag for the current object

If the object contains at least 1 error, the result is Error.

If the object contains at least 1 warning, the result is Warning.

If the object contains at least 1 message, the result is Remark.

If the object contains no errors, no warnings and no messages, the result is Blank.

Public propertySubCategory
Gets or sets the SubCategory in which this object belongs. If HasSubCategory() returns false, this field has no meaning.
(Inherited from GH_InstanceDescription.)
Top
Methods
  NameDescription
Public methodAddedToDocument
This method will be called when an object is added to a document. Override this method if you want to handle such events.
(Inherited from GH_DocumentObject.)
Public methodAddRuntimeMessage
Add a new message to this object. Valid message type flags are Warning and Error. If the Message string is empty or zero-length no message is added.
Public methodAppendAdditionalMenuItems
Override this function if you want to add additional items to the object context menu. Default items already included in the menu toolstrip are:

1. Name

2. Preview

3. Warnings

4. Errors

5. [additional items will be inserted here]

6. Help

Public methodAppendMenuItems
This function is called when a context menu is about to be displayed. Override it to set custom items. GH_ActiveObject will already populate the menu with default items, if you merely wish to insert object-specific menu item, consider overriding AppendAdditionalMenuItems instead.
(Overrides GH_DocumentObjectAppendMenuItems(ToolStripDropDown).)
Public methodClearData
This function is called whenever the object needs to clear all solution data. Override this function if you need to perform custom clensing.
Public methodClearRuntimeMessages
Destroy all warning and error lists
Public methodCollectData
This function is called whenever the object is required to collect all data. Either from Persistent records, from source params or whatever.
Public methodComputeData
This function is called whenever the object is required to generate new data.
Public methodCopyFrom
Copy all fields (except the instance ID) from another instance description.
(Inherited from GH_InstanceDescription.)
Public methodCreateAttributes
This function creates the stand-alone attributes for this object. If you wish to supply your own Attributes, you must override this function.
(Inherited from GH_DocumentObject.)
Public methodDependsOn
Returns a boolean indicating whether or not the current object somehow inherits from the PotenialSource object
Protected methodDestroyIconCache
Call this method to erase the existing icon cache. You must call this if you want to change the display icon of an object.
(Inherited from GH_DocumentObject.)
Public methodDocumentContextChanged
This method will be called when the document that owns this object moves into a different context.
(Inherited from GH_DocumentObject.)
Protected methodExpireDownStreamObjects
This function is called whenever the solution for this object expires. Override this function if objects depend on you.
Public methodExpirePreview
Call this function when you suspect that the preview has expired for this object. This will cause the display cache to be eradicated.
(Inherited from GH_DocumentObject.)
Public methodExpireSolution
Informs the document that owns this object that the solution has expired. The current object will be set to BLANK as a result. This method is recursive, it will also expire any and all objects which depend on this object. If you want a less destructive expiration, consider using ClearData(). If this object is already Blank, you should consider not expiring it.
(Overrides GH_DocumentObjectExpireSolution(Boolean).)
Protected methodGetValue(String, Boolean)
Get a boolean value from the component value table.
(Inherited from GH_DocumentObject.)
Protected methodGetValue(String, Double)
Get a double value from the component value table.
(Inherited from GH_DocumentObject.)
Protected methodGetValue(String, Color)
Get a color value from the component value table.
(Inherited from GH_DocumentObject.)
Protected methodGetValue(String, Int32)
Get an integer value from the component value table.
(Inherited from GH_DocumentObject.)
Protected methodGetValue(String, String)
Get a string value from the component value table.
(Inherited from GH_DocumentObject.)
Protected methodHtmlHelp_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
(Inherited from GH_DocumentObject.)
Public methodIsolateObject
Destroy all connections to other objects.
(Inherited from GH_DocumentObject.)
Protected methodMenu_AppendBakeItem
Append the default Bake menu item.
Protected methodMenu_AppendEnableItem
Append the default Enable/Disable menu item.
Protected methodMenu_AppendObjectHelp
Appends the default object Help menu item.
(Inherited from GH_DocumentObject.)
Protected methodMenu_AppendObjectName
Appends the old-fashioned object name menu item. If you also want the Display mode toggle then use Menu_AppendObjectNameEx()
(Inherited from GH_DocumentObject.)
Protected methodMenu_AppendObjectNameEx
Appends the default object name + display mode menu item.
(Inherited from GH_DocumentObject.)
Protected methodMenu_AppendPreviewItem
Append the default Show/Hide preview menu item.
Protected methodMenu_AppendPublish
Appends the default item for publishing to RCP. This menu will only appear if the current class implement IRcpAwareObject
(Inherited from GH_DocumentObject.)
Protected methodMenu_AppendRuntimeMessages
Append the default warnings and errors menu items.
Public methodMovedBetweenDocuments
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.
(Inherited from GH_DocumentObject.)
Public methodNewInstanceGuid
Generate a new random instance GUID
(Inherited from GH_InstanceDescription.)
Public methodNewInstanceGuid(Guid)
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.
(Inherited from GH_InstanceDescription.)
Public methodOnAttributesChanged
Raises the AttributesChanged event on the toplevel object.
(Inherited from GH_DocumentObject.)
Public methodOnDisplayExpired
Raises the DisplayExpired event on the toplevel object.
(Inherited from GH_DocumentObject.)
Public methodOnObjectChanged(GH_ObjectChangedEventArgs) (Inherited from GH_DocumentObject.)
Public methodOnObjectChanged(GH_ObjectEventType) (Inherited from GH_DocumentObject.)
Public methodOnObjectChanged(String) (Inherited from GH_DocumentObject.)
Public methodOnObjectChanged(GH_ObjectEventType, Object) (Inherited from GH_DocumentObject.)
Public methodOnObjectChanged(String, Object) (Inherited from GH_DocumentObject.)
Public methodOnPingDocument
Raise the PingDocument Event on the toplevel object and try to find the document which owns this object.
(Inherited from GH_DocumentObject.)
Public methodOnPreviewExpired
Raises the PreviewExpired event on the toplevel object.
(Inherited from GH_DocumentObject.)
Public methodOnSolutionExpired
Raises the SolutionExpired event on the toplevel object. You probably want to call ExpireSolution() instead of this method directly.
(Inherited from GH_DocumentObject.)
Public methodRead (Overrides GH_DocumentObjectRead(GH_IReader).)
Public methodReadFull
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.
(Inherited from GH_InstanceDescription.)
Public methodRecordUndoEvent(GH_UndoRecord)
Record an entire undo record.
(Inherited from GH_DocumentObject.)
Public methodRecordUndoEvent(String)
Record a generic object change undo event.
(Inherited from GH_DocumentObject.)
Public methodRecordUndoEvent(String, IGH_UndoAction)
Record a specific object change undo event.
(Inherited from GH_DocumentObject.)
Public methodRegisterRemoteIDs
Override this function if you want object changes in the Rhino document to trigger a new solution.
Public methodRemovedFromDocument
This method will be called when an object is removed from a document. Override this method if you want to handle such events.
(Inherited from GH_DocumentObject.)
Public methodRuntimeMessages
Gets the list of cached runtime messages that were recorded during solver-time processes.
Public methodSDKCompliancy
Test whether this object is compliant with a given Rhino version.
Public methodSetIconOverride
Set a new custom icon override for this object.
(Inherited from GH_DocumentObject.)
Protected methodSetValue(String, Boolean)
Set a named value. This value will be serialized with the component.
(Inherited from GH_DocumentObject.)
Protected methodSetValue(String, Double)
Set a named value. This value will be serialized with the component.
(Inherited from GH_DocumentObject.)
Protected methodSetValue(String, Color)
Set a named value. This value will be serialized with the component.
(Inherited from GH_DocumentObject.)
Protected methodSetValue(String, Int32)
Set a named value. This value will be serialized with the component.
(Inherited from GH_DocumentObject.)
Protected methodSetValue(String, String)
Set a named value. This value will be serialized with the component.
(Inherited from GH_DocumentObject.)
Public methodTriggerAutoSave
Triggers the AutoSave function on the owner document with the object_changed flag.
(Inherited from GH_DocumentObject.)
Public methodTriggerAutoSave(GH_AutoSaveTrigger)
Triggers the AutoSave function on the owner document with a custom flag.
(Inherited from GH_DocumentObject.)
Public methodTriggerAutoSave(Guid)
Triggers the AutoSave function on the owner document with the object_changed flag.
(Inherited from GH_DocumentObject.)
Public methodTriggerAutoSave(GH_AutoSaveTrigger, Guid)
Triggers the AutoSave function on the owner document with a custom flag.
(Inherited from GH_DocumentObject.)
Protected methodValuesChanged
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.
(Inherited from GH_DocumentObject.)
Public methodWrite (Overrides GH_DocumentObjectWrite(GH_IWriter).)
Public methodWriteFull
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.
(Inherited from GH_InstanceDescription.)
Top
Events
  NameDescription
Public eventAttributesChanged
Raised whenever the number or kind of attributes changes. This event is handled by GH_Documents who subsequently wipe their attribute caches.
(Inherited from GH_DocumentObject.)
Public eventDisplayExpired
Raised whenever the display (on the Canvas) of a certain object becomes invalid.
(Inherited from GH_DocumentObject.)
Public eventObjectChanged (Inherited from GH_DocumentObject.)
Public eventPingDocument
Raised whenever an object needs to know which GH_Document it belongs to.
(Inherited from GH_DocumentObject.)
Public eventPreviewExpired
Raised whenever the display (in the Rhino viewports) of a certain object becomes invalid.
(Inherited from GH_DocumentObject.)
Public eventSolutionExpired
Raised whenever the solution of a certain object becomes invalid.
(Inherited from GH_DocumentObject.)
Top
Fields
  NameDescription
Protected fieldm_attributes (Inherited from GH_DocumentObject.)
Top
See Also