Click or drag to resize

GH_UserObject Class

Represents a custom user object. A User Object is an existing IGH_DocumentObject with overridden icon, instance description and exposure.
Inheritance Hierarchy
SystemObject
  Grasshopper.KernelGH_UserObject

Namespace:  Grasshopper.Kernel
Assembly:  Grasshopper (in Grasshopper.dll)
Syntax
public class GH_UserObject

The GH_UserObject type exposes the following members.

Constructors
  NameDescription
Public methodGH_UserObject
Empty constructor
Public methodGH_UserObject(String)
Create a new user object from an existing *.ghuser file.
Top
Properties
  NameDescription
Public propertyBaseGuid
Gets or sets the ComponentID of the IGH_DocumentObject that functions as the base class for this User Object.
Public propertyData
Gets or sets the serialized data. This data is used to deserialize a new instance of the base class.
Public propertyDescription
Gets or sets the Instance Description override for this User Object.
Public propertyExposure
Gets or sets the Exposure of this User Object.
Public propertyGuid
Gets or sets the Guid of this User Object. The Guid is created anew during construction and is not stored in the User Object File. You should never have to set this field.
Public propertyIcon
Gets or sets the icon associated with this User Object. If the icon hasn't been overridden, then a Default icon is returned.
Public propertyPath
Gets or sets the file path this User Object is loaded from or saved to.
Top
Methods
  NameDescription
Public methodClear
Destroy all data except the file path and the ID.
Public methodCreateDefaultPath
Set the Path field for this user object to the default. The default file name is derived from the Description.Name field. This method also ensures the UserObject directory exists.
Public methodInstantiateObject
Instantiate a new IGH_DocumentObject from this User Object.
Public methodReadFromFile
Force an update of the local data from the file. The Path field must be set for this to work.
Public methodSaveToFile
Save the current User Object state to a file. Any existing file will be overwritten.
Public methodSetDataFromObject
Set the Data field content of ths UserObject from a Document object instance.
Top
See Also