Skip to content

DiGi.Rhino.Core

github-actions[bot] edited this page Jul 15, 2026 · 2 revisions

DiGi.Rhino.Core Namespace

Classes

Convert Class

public static class Convert

Inheritance System.Object → Convert

Methods

Convert.ToDiGi(this Interval) Method

Converts a Rhino.Geometry.Interval to a nullable DiGi.Core.Classes.Range<>.

public static DiGi.Core.Classes.Range<double>? ToDiGi(this Interval interval);

Parameters

interval Rhino.Geometry.Interval

The interval to convert.

Returns

DiGi.Core.Classes.Range<System.Double>
A DiGi.Core.Classes.Range<> of double representing the interval, or null if the interval is unset.

Create Class

public static class Create

Inheritance System.Object → Create

Methods

Create.GH_Goo(this ParameterType, object) Method

Converts a given value to its corresponding Grasshopper Goo representation based on the specified parameter type.

public static IGH_Goo? GH_Goo(this DiGi.Core.Parameter.Enums.ParameterType parameterType, object? value);

Parameters

parameterType DiGi.Core.Parameter.Enums.ParameterType

The type of parameter used to determine which GH_Goo implementation to create.

value System.Object

The object value to be converted into a Goo object.

Returns

Grasshopper.Kernel.Types.IGH_Goo
An Grasshopper.Kernel.Types.IGH_Goo instance wrapping the value, or null if the conversion fails or the value is null.

Exceptions

System.NotImplementedException
Thrown when the provided parameterType is not supported.

Create.GooParams(this IGooSerializableObject) Method

Retrieves the list of goo parameters associated with the specified serializable object.

public static System.Collections.Generic.List<DiGi.Rhino.Core.Classes.GooParam>? GooParams(this DiGi.Rhino.Core.Interfaces.IGooSerializableObject? gooSerializableObject);

Parameters

gooSerializableObject IGooSerializableObject

The serializable object to extract parameters from.

Returns

System.Collections.Generic.List<GooParam>
A list of GooParam objects if found; otherwise, null.

Create.GooParams(this object) Method

Retrieves the list of goo parameters associated with the specified object based on its type and inspection settings.

public static System.Collections.Generic.List<DiGi.Rhino.Core.Classes.GooParam>? GooParams(this object? @object);

Parameters

object System.Object

The object to inspect for parameters.

Returns

System.Collections.Generic.List<GooParam>
A list of GooParam objects if found; otherwise, null.

Inspect Class

public static class Inspect

Inheritance System.Object → Inspect

Methods

Inspect.City(this Address) Method

Extracts the city name from the provided address as a Grasshopper string.

public static GH_String? City(this DiGi.Core.Classes.Address? address);

Parameters

address DiGi.Core.Classes.Address

The address object to inspect.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the city, or null if the address is null.

Inspect.CountryCode(this Address) Method

Extracts the country code from the provided address as a Grasshopper enum.

public static DiGi.Rhino.Core.Classes.GooEnum? CountryCode(this DiGi.Core.Classes.Address? address);

Parameters

address DiGi.Core.Classes.Address

The address object to inspect.

Returns

GooEnum
A GooEnum containing the country code, or null if the address is null.

Inspect.DateTimes(this ITimeSeries) Method

Extracts the date-times from a time series and converts them into a collection of Grasshopper GH_Time objects.

public static System.Collections.IEnumerable? DateTimes(this DiGi.Core.Interfaces.ITimeSeries? timeSeries);

Parameters

timeSeries DiGi.Core.Interfaces.ITimeSeries

The time series instance to inspect.

Returns

System.Collections.IEnumerable
An enumerable collection of Grasshopper.Kernel.Types.GH_Time objects if the time series is provided; otherwise, null.

Inspect.FullTypeName(this Type) Method

Gets the full type name of the specified type as a Grasshopper.Kernel.Types.GH_String.

public static GH_String? FullTypeName(this System.Type? type);

Parameters

type System.Type

The type to inspect.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the formatted full type name, or null if the provided type is null.

Inspect.GroupName(this IParameterDefinition) Method

Gets the group name of the specified parameter definition as a Grasshopper.Kernel.Types.GH_String.

public static GH_String? GroupName(this DiGi.Core.Parameter.Interfaces.IParameterDefinition? parameterDefinition);

Parameters

parameterDefinition DiGi.Core.Parameter.Interfaces.IParameterDefinition

The parameter definition to inspect.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the group name, or null if the parameterDefinition is null.

Inspect.Guid(this IGuidObject) Method

Converts an DiGi.Core.Interfaces.IGuidObject to a Grasshopper Grasshopper.Kernel.Types.GH_Guid.

public static GH_Guid? Guid(this DiGi.Core.Interfaces.IGuidObject? guidObject);

Parameters

guidObject DiGi.Core.Interfaces.IGuidObject

The object implementing DiGi.Core.Interfaces.IGuidObject to be converted.

Returns

Grasshopper.Kernel.Types.GH_Guid
A Grasshopper.Kernel.Types.GH_Guid representation of the object's GUID, or null if the provided guidObject is null.

Inspect.Name(this Parameter) Method

Gets the name of the specified parameter as a Grasshopper.Kernel.Types.GH_String.

public static GH_String? Name(this DiGi.Core.Parameter.Classes.Parameter? parameter);

Parameters

parameter DiGi.Core.Parameter.Classes.Parameter

The parameter to inspect.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the parameter's name, or null if the parameter is null.

Inspect.Name(this IParameterDefinition) Method

Gets the name of the specified parameter definition as a Grasshopper.Kernel.Types.GH_String.

public static GH_String? Name(this DiGi.Core.Parameter.Interfaces.IParameterDefinition? parameterDefinition);

Parameters

parameterDefinition DiGi.Core.Parameter.Interfaces.IParameterDefinition

The parameter definition to inspect.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the name, or null if the parameterDefinition is null.

Inspect.Name(this Type) Method

Gets the name of the specified type as a Grasshopper.Kernel.Types.GH_String.

public static GH_String? Name(this System.Type? type);

Parameters

type System.Type

The type to inspect.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the full name of the type, or null if the provided type is null.

Inspect.ParameterDefinition(this Parameter) Method

Gets the definition of the specified parameter as a GooParameterDefinition.

public static DiGi.GIS.Rhino.Classes.GooParameterDefinition? ParameterDefinition(this DiGi.Core.Parameter.Classes.Parameter? parameter);

Parameters

parameter DiGi.Core.Parameter.Classes.Parameter

The parameter to inspect.

Returns

GooParameterDefinition
A GooParameterDefinition wrapping the parameter's definition, or null if the parameter is null.

Inspect.Parameters(this IParametrizedObject) Method

Retrieves a collection of parameters from the specified parametrized object.

public static System.Collections.IEnumerable? Parameters(this DiGi.Core.Parameter.Interfaces.IParametrizedObject? parametrizedObject);

Parameters

parametrizedObject DiGi.Core.Parameter.Interfaces.IParametrizedObject

The object that implements DiGi.Core.Parameter.Interfaces.IParametrizedObject and contains the parameters to be retrieved.

Returns

System.Collections.IEnumerable
An enumerable collection of GooParameter objects if successful; otherwise, null.

Inspect.ParameterType(this Parameter) Method

Gets the type of the specified parameter as a GooEnum.

public static DiGi.Rhino.Core.Classes.GooEnum? ParameterType(this DiGi.Core.Parameter.Classes.Parameter? parameter);

Parameters

parameter DiGi.Core.Parameter.Classes.Parameter

The parameter to inspect.

Returns

GooEnum
A GooEnum wrapping the parameter's type, or null if the parameter is null.

Inspect.ParameterType(this IParameterDefinition) Method

Gets the parameter type of the specified parameter definition as a GooEnum.

public static DiGi.Rhino.Core.Classes.GooEnum? ParameterType(this DiGi.Core.Parameter.Interfaces.IParameterDefinition? parameterDefinition);

Parameters

parameterDefinition DiGi.Core.Parameter.Interfaces.IParameterDefinition

The parameter definition to inspect.

Returns

GooEnum
A GooEnum containing the parameter type, or null if the parameterDefinition is null.

Inspect.PostalCode(this Address) Method

Extracts the postal code from the provided address as a Grasshopper string.

public static GH_String? PostalCode(this DiGi.Core.Classes.Address? address);

Parameters

address DiGi.Core.Classes.Address

The address object to inspect.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the postal code, or null if the address is null.

Inspect.Street(this Address) Method

Extracts the street name from the provided address as a Grasshopper string.

public static GH_String? Street(this DiGi.Core.Classes.Address? address);

Parameters

address DiGi.Core.Classes.Address

The address object to inspect.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the street, or null if the address is null.

Inspect.UniqueId(this IUniqueIdObject) Method

Extracts the unique identifier from an object implementing DiGi.Core.Interfaces.IUniqueIdObject and wraps it in a Grasshopper.Kernel.Types.GH_String.

public static GH_String? UniqueId(this DiGi.Core.Interfaces.IUniqueIdObject? uniqueIdObject);

Parameters

uniqueIdObject DiGi.Core.Interfaces.IUniqueIdObject

The object that provides the unique identifier.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the unique ID if the input is not null; otherwise, null.

Inspect.UniqueId(this IParameterDefinition) Method

Gets the unique identifier of the specified parameter definition as a Grasshopper.Kernel.Types.GH_String.

public static GH_String? UniqueId(this DiGi.Core.Parameter.Interfaces.IParameterDefinition? parameterDefinition);

Parameters

parameterDefinition DiGi.Core.Parameter.Interfaces.IParameterDefinition

The parameter definition to inspect.

Returns

Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the unique identifier, or null if the parameterDefinition is null.

Inspect.Value(this Parameter) Method

Gets the value of the specified parameter as an Grasshopper.Kernel.Types.IGH_Goo object.

public static IGH_Goo? Value(this DiGi.Core.Parameter.Classes.Parameter? parameter);

Parameters

parameter DiGi.Core.Parameter.Classes.Parameter

The parameter to inspect.

Returns

Grasshopper.Kernel.Types.IGH_Goo
An Grasshopper.Kernel.Types.IGH_Goo representation of the parameter's value, or null if the parameter is null.

Query Class

public static class Query

Inheritance System.Object → Query

Methods

Query.Clone(this IGH_Param) Method

Creates a duplicate of the specified Grasshopper parameter, ensuring it has a new instance GUID and updating its nickname based on the central settings if applicable.

public static IGH_Param Clone(this IGH_Param param);

Parameters

param Grasshopper.Kernel.IGH_Param

The Grasshopper parameter to clone.

Returns

Grasshopper.Kernel.IGH_Param
A new instance of the cloned Grasshopper.Kernel.IGH_Param.

Query.Name(this Type) Method

Gets the name of the specified type, removing the 'I' prefix if it is an interface following standard naming conventions (where the second character is uppercase).

public static string? Name(this System.Type? type);

Parameters

type System.Type

The System.Type to retrieve the name from.

Returns

System.String
The processed name of the type, or null if the provided type is null.

Query.SaveAs(this IGH_Structure) Method

Prompts the user to save a Grasshopper structure containing serializable objects to a JSON file.

public static bool SaveAs(this IGH_Structure gH_Structure);

Parameters

gH_Structure Grasshopper.Kernel.Data.IGH_Structure

The Grasshopper structure to evaluate for serializable objects and save.

Returns

System.Boolean
True if the file was successfully saved and exists on disk; otherwise, false.

Query.SerializableObjects<T>(this IGH_Structure) Method

Extracts a list of serializable objects of a specific type from a Grasshopper structure.

public static System.Collections.Generic.List<T>? SerializableObjects<T>(this IGH_Structure? gH_Structure)
    where T : DiGi.Core.Interfaces.ISerializableObject;

Type parameters

T

The type of serializable object to extract. Must implement DiGi.Core.Interfaces.ISerializableObject.

Parameters

gH_Structure Grasshopper.Kernel.Data.IGH_Structure

The Grasshopper structure to query for serializable objects.

Returns

System.Collections.Generic.List<T>
A list containing the found objects of type T, or null if the provided structure is null.

Query.Subcategory(this Type) Method

Extracts the subcategory name from the assembly of the provided type. If the assembly name is missing, it defaults to "DiGi". If the assembly name contains more than two segments separated by dots, only the first two are returned.

public static string Subcategory(this System.Type type);

Parameters

type System.Type

The System.Type for which the subcategory is being determined.

Returns

System.String
A string representing the subcategory of the type's assembly.

Query.TryGetValue(this IGH_Goo, object) Method

Attempts to retrieve the value from an Grasshopper.Kernel.Types.IGH_Goo object by accessing its "Value" property via reflection.

public static bool TryGetValue(this IGH_Goo? gH_Goo, out object? value);

Parameters

gH_Goo Grasshopper.Kernel.Types.IGH_Goo

The Grasshopper Goo object to extract the value from.

value System.Object

When this method returns, contains the extracted value if successful; otherwise, null.

Returns

System.Boolean
true if the "Value" property was found and successfully read; otherwise, false.

Query.TryGetValue<TObject>(this object, TObject) Method

Attempts to retrieve a value of a specific type from an object, handling both standard objects and those wrapped in Grasshopper.Kernel.Types.IGH_Goo.

public static bool TryGetValue<TObject>(this object? @object, out TObject? value);

Type parameters

TObject

The expected type of the resulting value.

Parameters

object System.Object

The object to evaluate.

value TObject

When this method returns, contains the extracted value cast to TObject if successful; otherwise, the default value of TObject.

Returns

System.Boolean
true if the object (or its wrapped value) is of type TObject; otherwise, false.

Query.TryGetValue<TSerializableObject>(this IGooSerializableObject, TSerializableObject) Method

Attempts to retrieve the value of a serializable object from an IGooSerializableObject wrapper, cast to a specific type.

public static bool TryGetValue<TSerializableObject>(this DiGi.Rhino.Core.Interfaces.IGooSerializableObject? gooSerializableObject, out TSerializableObject? serializableObject)
    where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject;

Type parameters

TSerializableObject

The expected type of the serializable object. Must implement DiGi.Core.Interfaces.ISerializableObject.

Parameters

gooSerializableObject IGooSerializableObject

The serializable object wrapper to extract the value from.

serializableObject TSerializableObject

When this method returns, contains the extracted serializable object if successful; otherwise, the default value of TSerializableObject.

Returns

System.Boolean
true if the value was successfully extracted and is of type TSerializableObject; otherwise, false.

Query.Value(this IGooSerializableObject, GooParam) Method

Retrieves a value from an IGooSerializableObject based on the specified GooParam.

public static object? Value(this DiGi.Rhino.Core.Interfaces.IGooSerializableObject? gooSerializableObject, DiGi.Rhino.Core.Classes.GooParam? gooParam);

Parameters

gooSerializableObject IGooSerializableObject

The serializable object to extract the value from.

gooParam GooParam

The parameter definition used to identify the value.

Returns

System.Object
The extracted value if found; otherwise, null.

Query.Value(this object, GooParam) Method

Retrieves a value from an object based on the specified GooParam by inspecting the object's type.

public static object? Value(this object? @object, DiGi.Rhino.Core.Classes.GooParam? gooParam);

Parameters

object System.Object

The object to inspect.

gooParam GooParam

The parameter definition used to identify the value.

Returns

System.Object
The extracted value if found; otherwise, null.

Settings Class

public static class Settings

Inheritance System.Object → Settings

Properties

Settings.InspectManager Property

Gets the global instance of the InspectManager.

public static DiGi.Rhino.Core.Classes.InspectManager InspectManager { get; }

Property Value

InspectManager

Clone this wiki locally