Constructors
GH_Timer
#public GH_Timer()
Fields
m_attributes
protected IGH_Attributes m_attributes
Properties
AllowModeSwitching
#Override this property and return false to disable switching between manual and scheduled modes.
Attributes
Gets or sets the attributes that are associated with this object. Only set custom attributes if you know what you are doing.
Implements: Attributes
Category
Gets or sets the Category in which this object belongs. If HasCategory() returns false, this field has no meaning.
Implements: Category
Description
Gets or sets the description of the object. This field typically remains fixed during the lifetime of an object.
Implements: Description
DisplayUserName
#Override this property and return false to not include the user name in the attributes.
Implements: HasCategory
HasSubCategory
Gets whether or not the SubCategory field has been set.
Implements: HasSubCategory
Icon_24x24
public Bitmap Icon_24x24 { get; }
The icon associated with this object.
Implements: Icon_24x24
Icon_24x24_Locked
public Bitmap Icon_24x24_Locked { get; }
The greyscale icon of this object.
Implements: Icon_24x24_Locked
IconDisplayMode
Gets the current display mode of the object.
Implements: IconDisplayMode
Implements: InstanceGuid
Internal_Icon_24x24
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
protected virtual Bitmap Internal_Icon_24x24 { get; }
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.
Interval
#Gets or sets the interval (in milliseconds between timer ticks). Any interval less than or equal to zero results in a manual timer.
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.
Implements: Keywords
Locked
Gets or sets the enabled flag of this object. Disabled objects are ignored during solutions.
Implements: Locked
LockTargets
#Gets or sets whether the target objects ought to be locked while not triggered by this timer. This property does not itself perform any locking/unlocking, that is the responsibility of the caller.
Manual
#Gets whether updates must be triggered manually or whether they are automatically scheduled. Negative interval values imply a manual trigger.
MutableNickName
Gets or sets a value that enables Nick name changes through the menu. The default is TRUE.
Implements: MutableNickName
Name
Gets or sets the name of the object. This field typically remains fixed during the lifetime of an object.
Implements: Name
NickName
Gets or sets the nickname of the object. This field can be changed by the user.
Implements: 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.
Implements: Obsolete
Phase
Gets or sets the solution phase this object is currenly in.
Implements: Phase
ProcessorTime
Gets the most recent processor time profiler value.
Implements: ProcessorTime
RuntimeMessageLevel
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.
Implements: RuntimeMessageLevel
SubCategory
Gets or sets the SubCategory in which this object belongs. If HasSubCategory() returns false, this field has no meaning.
Implements: SubCategory
TargetsRecursive
#Gets the target specified by this trigger, and by any other trigger which is referenced by this trigger.
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.
Parameters:
| document (GH_Document) | Document that now owns this object. |
Implements: AddedToDocument
AddRuntimeMessage
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.
Parameters:
| level (GH_RuntimeMessageLevel) | Type of message. Only Warnings and Errors are recorded. |
| text (string) | Content of message. |
Implements: AddRuntimeMessage
AddTarget
#[EditorBrowsable(EditorBrowsableState.Never)]
public void AddTarget(IGH_DocumentObject target_object)
Parameters:
| target_object (IGH_DocumentObject) |
CleanTargetList
#public void CleanTargetList()
Remove all targets which can no longer be resolved. You typically don't want to call this as objects may have been deleted but may be re-instated via UNDO again. There's no real harm in having 'dirty' targets.
ClearData
public virtual void ClearData()
This function is called whenever the object needs to clear all solution data. Override this function if you need to perform custom clensing.
Implements: ClearData
ClearRuntimeMessages
public virtual void ClearRuntimeMessages()
Destroy all warning and error lists
Implements: ClearRuntimeMessages
ComputeData
public virtual void ComputeData()
This function is called whenever the object is required to generate new data.
Implements: ComputeData
CopyFrom
Copy all fields (except the instance ID) from another instance description.
Parameters:
| other (IGH_InstanceDescription) | Object to mimic. |
CreateAttributes
#public override void CreateAttributes()
Overrides: GH_DocumentObject.CreateAttributes
DestroyBlockIcon
#public static void DestroyBlockIcon()
DestroyIconCache
protected void 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.
DocumentContextChanged
This method will be called when the document that owns this object moves into a different context.
Parameters:
| document (GH_Document) | Document that owns this object. |
| context (GH_DocumentContext) | The reason for this event. |
Implements: DocumentContextChanged
EnsureBlockIcon
#public static void EnsureBlockIcon()
ExpireDownStreamObjects
protected virtual void ExpireDownStreamObjects()
This function is called whenever the solution for this object expires. Override this function if objects depend on you.
ExpirePreview
Call this function when you suspect that the preview has expired for this object. This will cause the display cache to be eradicated.
Parameters:
| redraw (bool) |
Implements: ExpirePreview
ExpireSolution
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.
Parameters:
| recompute (bool) | If True, the document will be instructed to solve the new state. |
Overrides: GH_DocumentObject.ExpireSolution
ExpireTargets
#public void ExpireTargets()
Expire all target objects, but do not start a new solution.
ExpireTargets
#Expire all target objects, but do not start a new solution.
Parameters:
| count (ref int) | Number of targets that were expired. |
GetValue
Get a boolean value from the component value table.
GetValue
Get a color value from the component value table.
GetValue
Get a double value from the component value table.
GetValue
Get an integer value from the component value table.
GetValue
Get a string value from the component value table.
IsolateObject
public virtual void IsolateObject()
Destroy all connections to other objects.
Implements: IsolateObject
LockAllTargetObjects
#public void LockAllTargetObjects()
Lock all target objects if the LockTargets property is set to true.
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.
Parameters:
| oldDocument (GH_Document) | Document that used to own this object. |
| newDocument (GH_Document) | Document that now owns ths object. |
Implements: MovedBetweenDocuments
NewInstanceGuid
public void NewInstanceGuid()
Generate a new random instance GUID
Implements: 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.
Parameters:
| UUID (Guid) |
Implements: NewInstanceGuid
OnAttributesChanged
public void OnAttributesChanged()
Raises the AttributesChanged event on the toplevel object.
Implements: OnAttributesChanged
OnDisplayExpired
Raises the DisplayExpired event on the toplevel object.
Parameters:
| redraw (bool) | If True, the canvas will be immediately redrawn. |
Implements: OnDisplayExpired
OnObjectChanged
Parameters:
| e (GH_ObjectChangedEventArgs) |
Implements: OnObjectChanged
OnObjectChanged
Parameters:
| eventType (GH_ObjectEventType) | |
| tag (object) |
Implements: OnObjectChanged
OnObjectChanged
Parameters:
| eventType (GH_ObjectEventType) |
Implements: OnObjectChanged
Implements: OnObjectChanged
OnObjectChanged
Parameters:
| customEvent (string) |
Implements: OnObjectChanged
OnPingDocument
Raise the PingDocument Event on the toplevel object and try to find the document which owns this object.
Returns: The document which owns this object if successful, or nothing if no document owns this object.
Implements: OnPingDocument
OnPreviewExpired
Raises the PreviewExpired event on the toplevel object.
Parameters:
| redraw (bool) | If True, the viewports will be immediately redrawn. |
Implements: OnPreviewExpired
OnSolutionExpired
Raises the SolutionExpired event on the toplevel object. You probably want to call ExpireSolution() instead of this method directly.
Parameters:
| recompute (bool) | If True, the solution will be immediately recalculated. |
Implements: OnSolutionExpired
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.
Parameters:
| reader (GH_IReader) | Writer for deserialization. |
Returns: True on success, false on failure.
RecordUndoEvent
Record a specific object change undo event.
Parameters:
| undoName (string) | Name of undo record. |
| action (IGH_UndoAction) | Undo action to record. |
Returns: The ID of the newly added record or Guid.Empty on failure.
Implements: RecordUndoEvent
RecordUndoEvent
Record a generic object change undo event.
Parameters:
| undoName (string) | Name of undo record. |
Returns: The ID of the newly added record or Guid.Empty on failure.
Implements: RecordUndoEvent
Parameters:
| record (GH_UndoRecord) | Record to push. |
Implements: RecordUndoEvent
RegisterRemoteIDs
Override this function if you want object changes in the Rhino document to trigger a new solution.
Parameters:
| id_list (GH_GuidTable) | The object ID database Grasshopper is responsive to. |
Implements: RegisterRemoteIDs
RemovedFromDocument
This method will be called when an object is removed from a document. Override this method if you want to handle such events.
Parameters:
| document (GH_Document) | Document that now no longer owns this object. |
Implements: RemovedFromDocument
RemoveTarget
#[EditorBrowsable(EditorBrowsableState.Never)]
public void RemoveTarget(IGH_DocumentObject target_object)
Parameters:
| target_object (IGH_DocumentObject) |
RuntimeMessages
Gets the list of cached runtime messages that were recorded during solver-time processes.
Parameters:
| level (GH_RuntimeMessageLevel) | Runtime message type to retrieve. |
Returns: A list of runtime message strings.
Implements: RuntimeMessages
SDKCompliancy
Test whether this object is compliant with a given Rhino version.
Parameters:
| exeVersion (int) | Rhino major release (4, 5, ...). |
| exeServiceRelease (int) | Rhino minor (service) release. |
Returns: True if this object is compliant with the given Rhino release.
Implements: SDKCompliancy
SetIconOverride
public void SetIconOverride(Bitmap customIcon)
Set a new custom icon override for this object.
Parameters:
| customIcon (Bitmap) | Icon override. Should be a 24x24 image. |
SetValue
Set a named value. This value will be serialized with the component.
SetValue
Set a named value. This value will be serialized with the component.
SetValue
Set a named value. This value will be serialized with the component.
SetValue
Set a named value. This value will be serialized with the component.
SetValue
Set a named value. This value will be serialized with the component.
TriggerAutoSave
public void TriggerAutoSave()
Triggers the AutoSave function on the owner document with the object_changed flag.
Implements: TriggerAutoSave
TriggerAutoSave
Triggers the AutoSave function on the owner document with a custom flag.
Parameters:
| trigger (GH_AutoSaveTrigger) | 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 (Guid) | ID of autosave event. Consecutive autosave requests with the same ID will be ignored. |
Implements: TriggerAutoSave
TriggerAutoSave
Triggers the AutoSave function on the owner document with a custom flag.
Parameters:
| trigger (GH_AutoSaveTrigger) | 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. |
Implements: TriggerAutoSave
TriggerAutoSave
Triggers the AutoSave function on the owner document with the object_changed flag.
Parameters:
| id (Guid) | ID of autosave event. Consecutive autosave requests with the same ID will be ignored. |
Implements: TriggerAutoSave
ValuesChanged
protected virtual void 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.
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.
Parameters:
| writer (GH_IWriter) | Writer for serialization. |
Returns: 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.
Implements: AttributesChanged
DisplayExpired
Raised whenever the display (on the Canvas) of a certain object becomes invalid.
Implements: DisplayExpired
ObjectChanged
Implements: ObjectChanged
PingDocument
Raised whenever an object needs to know which GH_Document it belongs to.
Implements: PingDocument
PreviewExpired
Raised whenever the display (in the Rhino viewports) of a certain object becomes invalid.
Implements: PreviewExpired
SolutionExpired
Raised whenever the solution of a certain object becomes invalid.
Implements: SolutionExpired