GH_InstanceDescription

References
Base implementation of IGH_InstanceDescription. Consider deriving from this class rather than implementing IGH_InstanceDescription from scratch.

Constructors

GH_InstanceDescription

#
public GH_InstanceDescription()
Create a new blank instance.

GH_InstanceDescription

#
public GH_InstanceDescription(IGH_InstanceDescription other)
Duplicate another instance description.
other (IGH_InstanceDescription)Instance description to duplicate

GH_InstanceDescription

#
public GH_InstanceDescription(string name, string nickName, string description, string category, string subCategory)
Create a new instance.
name (string)Name of instance description.
nickName (string)Nickname of instance description.
description (string)Descirptive text of instance description.
category (string)Category of instance description.
subCategory (string)Subcategory of the instance description.

GH_InstanceDescription

#
[EditorBrowsable(EditorBrowsableState.Never)] public GH_InstanceDescription(string name, string nickName, string description, string category)
Create a new instance. This constructor is maintained for legacy purposes, use the constructor overload that includes SubCategories!.
name (string)Name of instance description.
nickName (string)Nickname of instance description.
description (string)Descirptive text of instance description.
category (string)Category of instance description. If you supply a name containing a dot, subcategory will be inferred.

Properties

Category

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

Description

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

HasCategory

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

HasSubCategory

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

InstanceDescription

#
public virtual string InstanceDescription { get; }
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.

InstanceGuid

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

Keywords

#
public virtual IEnumerable<string> Keywords { get; }
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.
Keywords

Name

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

NickName

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

SubCategory

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

Methods

CopyFrom

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

NewInstanceGuid

#
public void NewInstanceGuid()
Generate a new random instance GUID
NewInstanceGuid

NewInstanceGuid

#
public void NewInstanceGuid(Guid UUID)
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.
UUID (Guid)
NewInstanceGuid

Read

#
public virtual bool Read(GH_IReader reader)
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().
reader (GH_IReader)Object to deserialize with.
Always True.
Read

ReadFull

#
public virtual bool ReadFull(GH_IReader reader)
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.
reader (GH_IReader)Writer for deserialization.
True on success, false on failure.

Write

#
public virtual bool Write(GH_IWriter writer)
Default serialization. Only stores Name, NickName, Description and InstanceGuid fields. If you want to store additional fields use WriteFull() instead.
writer (GH_IWriter)Object to serialize with.
Always True.
Write

WriteFull

#
public virtual bool WriteFull(GH_IWriter writer)
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.
writer (GH_IWriter)Writer for serialization.
True on success, false on failure.