GH_InstanceDescription
Base implementation of IGH_InstanceDescription. Consider deriving from this class rather than implementing IGH_InstanceDescription from scratch.
Inheritance Hierarchy
System.Object
Grasshopper.Kernel.GH_InstanceDescription
Grasshopper.Kernel.GH_DocumentObject
Namespace: Grasshopper.Kernel
Assembly: Grasshopper (in Grasshopper.dll)
Syntax
public class GH_InstanceDescription : IGH_InstanceDescription
The GH_InstanceDescription type exposes the following members.
Properties
Name
Description
Public Property
Category
Gets or sets the Category in which this object belongs. If HasCategory() returns false, this field has no meaning.
Public Property
Description
Gets or sets the description of the object. This field typically remains fixed during the lifetime of an object.
Public Property
HasCategory
Gets whether or not the Category field has been set.
Public Property
HasSubCategory
Gets whether or not the SubCategory field has been set.
Public Property
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 Property
InstanceGuid
Gets the ID of this runtime instance.
Public Property
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 Property
Name
Gets or sets the name of the object. This field typically remains fixed during the lifetime of an object.
Public Property
NickName
Gets or sets the nickname of the object. This field can be changed by the user.
Public Property
SubCategory
Gets or sets the SubCategory in which this object belongs. If HasSubCategory() returns false, this field has no meaning.
Methods
Name
Description
Public Method
CopyFrom
Copy all fields (except the instance ID) from another instance description.
Public Method
NewInstanceGuid.
Generate a new random instance GUID
Public Method
NewInstanceGuid(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.
Public Method
Read
Default deserialization. Only retrieves Name, NickName, Description and InstanceGuid fields. If you want to retrieve additional fields use ReadFull() instead. However, ReadFull() will only work if the archive was written using WriteFull().
Public Method
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 Method
Write
Default serialization. Only stores Name, NickName, Description and InstanceGuid fields. If you want to store additional fields use WriteFull() instead.
Public Method
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.