IGH_DocumentObject
ReferencesNothing matches.
Base interface for objects that want to play on the Canvas. Do not implement this interface from scratch. Either inherit from GH_DocumentObject or one of the other partially finished types such as GH_ActiveObject, GH_Param(Of T) or GH_Component.
Properties
Attributes
#Gets or sets the attributes that are associated with this object. Only set custom attributes if you know what you are doing.
Category
Gets or sets the Category in which this object belongs. If HasCategory() returns false, this field has no meaning.
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.
Description
Gets or sets the description of the object. This field typically remains fixed during the lifetime of an object.
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.
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.
Name
Gets or sets the name of the object. This field typically remains fixed during the lifetime of an object.
NickName
Gets or sets the nickname of the object. This field can be changed by the user.
SubCategory
Gets or sets the SubCategory in which this object belongs. If HasSubCategory() returns false, this field has no meaning.
Methods
CreateAttributes
#Create new default attributes for this object. You should only call this function when the Attributes() field is null.
void CreateAttributes()
DocumentContextChanged
#This method will be called when the document that owns this object moves into a different context.
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.
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.
MovedBetweenDocuments
#This method will be called when an object is moved from one document to another.
void MovedBetweenDocuments()
oldDocument,
Document that used to own this object.
newDocument
Document that now owns ths object.
NewInstanceGuid
Generate a new random instance GUID
void 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 called David.
OnAttributesChanged
#Raises the AttributesChanged event on the toplevel object.
void OnAttributesChanged()
OnObjectChanged
#Raises the ObjectChanged event on the current (!not the top level!) object.
void OnObjectChanged()
OnObjectChanged
#Raises the ObjectChanged event on the current (!not the top level!) object.
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.
Read
This method is called whenever the instance is required to deserialize itself.
Returns: True on success, false on failure.
RecordUndoEvent
#Record a generic object change undo event.
TriggerAutoSave
#Triggers the AutoSave function on the owner document with the object_changed flag.
void TriggerAutoSave()
TriggerAutoSave
#Triggers the AutoSave function on the owner document with a custom flag.
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
#Triggers the AutoSave function on the owner document with a custom flag.
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
#Triggers the AutoSave function on the owner document with the object_changed flag.
void TriggerAutoSave()
Write
This method is called whenever the instance is required to serialize itself.
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.
ObjectChanged
#Raised whenever some property of the object changes that would affect remote instances.
PreviewExpired
#Raised whenever the display (in the Rhino viewports) of a certain object becomes invalid.