-
Notifications
You must be signed in to change notification settings - Fork 0
DiGi.Rhino.Core
public static class ConvertInheritance System.Object → Convert
Converts a Rhino.Geometry.Interval to a nullable DiGi.Core.Classes.Range<>.
public static DiGi.Core.Classes.Range<double>? ToDiGi(this Interval interval);interval Rhino.Geometry.Interval
The interval to convert.
DiGi.Core.Classes.Range<System.Double>
A DiGi.Core.Classes.Range<> of double representing the interval, or null if the interval is unset.
public static class CreateInheritance System.Object → Create
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);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.
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.
System.NotImplementedException
Thrown when the provided parameterType is not supported.
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);gooSerializableObject IGooSerializableObject
The serializable object to extract parameters from.
System.Collections.Generic.List<GooParam>
A list of GooParam objects if found; otherwise, null.
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);object System.Object
The object to inspect for parameters.
System.Collections.Generic.List<GooParam>
A list of GooParam objects if found; otherwise, null.
public static class InspectInheritance System.Object → Inspect
Extracts the city name from the provided address as a Grasshopper string.
public static GH_String? City(this DiGi.Core.Classes.Address? address);address DiGi.Core.Classes.Address
The address object to inspect.
Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the city, or null if the address is null.
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);address DiGi.Core.Classes.Address
The address object to inspect.
GooEnum
A GooEnum containing the country code, or null if the address is null.
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);timeSeries DiGi.Core.Interfaces.ITimeSeries
The time series instance to inspect.
System.Collections.IEnumerable
An enumerable collection of Grasshopper.Kernel.Types.GH_Time objects if the time series is provided; otherwise, null.
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);type System.Type
The type to inspect.
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.
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);parameterDefinition DiGi.Core.Parameter.Interfaces.IParameterDefinition
The parameter definition to inspect.
Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the group name, or null if the parameterDefinition is null.
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);guidObject DiGi.Core.Interfaces.IGuidObject
The object implementing DiGi.Core.Interfaces.IGuidObject to be converted.
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.
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);parameter DiGi.Core.Parameter.Classes.Parameter
The parameter to inspect.
Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the parameter's name, or null if the parameter is null.
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);parameterDefinition DiGi.Core.Parameter.Interfaces.IParameterDefinition
The parameter definition to inspect.
Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the name, or null if the parameterDefinition is null.
Gets the name of the specified type as a Grasshopper.Kernel.Types.GH_String.
public static GH_String? Name(this System.Type? type);type System.Type
The type to inspect.
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.
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);parameter DiGi.Core.Parameter.Classes.Parameter
The parameter to inspect.
GooParameterDefinition
A GooParameterDefinition wrapping the parameter's definition, or null if the parameter is null.
Retrieves a collection of parameters from the specified parametrized object.
public static System.Collections.IEnumerable? Parameters(this DiGi.Core.Parameter.Interfaces.IParametrizedObject? parametrizedObject);parametrizedObject DiGi.Core.Parameter.Interfaces.IParametrizedObject
The object that implements DiGi.Core.Parameter.Interfaces.IParametrizedObject and contains the parameters to be retrieved.
System.Collections.IEnumerable
An enumerable collection of GooParameter objects if successful; otherwise, null.
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);parameter DiGi.Core.Parameter.Classes.Parameter
The parameter to inspect.
GooEnum
A GooEnum wrapping the parameter's type, or null if the parameter is null.
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);parameterDefinition DiGi.Core.Parameter.Interfaces.IParameterDefinition
The parameter definition to inspect.
GooEnum
A GooEnum containing the parameter type, or null if the parameterDefinition is null.
Extracts the postal code from the provided address as a Grasshopper string.
public static GH_String? PostalCode(this DiGi.Core.Classes.Address? address);address DiGi.Core.Classes.Address
The address object to inspect.
Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the postal code, or null if the address is null.
Extracts the street name from the provided address as a Grasshopper string.
public static GH_String? Street(this DiGi.Core.Classes.Address? address);address DiGi.Core.Classes.Address
The address object to inspect.
Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the street, or null if the address is null.
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);uniqueIdObject DiGi.Core.Interfaces.IUniqueIdObject
The object that provides the unique identifier.
Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the unique ID if the input is not null; otherwise, null.
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);parameterDefinition DiGi.Core.Parameter.Interfaces.IParameterDefinition
The parameter definition to inspect.
Grasshopper.Kernel.Types.GH_String
A Grasshopper.Kernel.Types.GH_String containing the unique identifier, or null if the parameterDefinition is null.
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);parameter DiGi.Core.Parameter.Classes.Parameter
The parameter to inspect.
Grasshopper.Kernel.Types.IGH_Goo
An Grasshopper.Kernel.Types.IGH_Goo representation of the parameter's value, or null if the parameter is null.
public static class QueryInheritance System.Object → Query
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);param Grasshopper.Kernel.IGH_Param
The Grasshopper parameter to clone.
Grasshopper.Kernel.IGH_Param
A new instance of the cloned Grasshopper.Kernel.IGH_Param.
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);type System.Type
The System.Type to retrieve the name from.
System.String
The processed name of the type, or null if the provided type is null.
Prompts the user to save a Grasshopper structure containing serializable objects to a JSON file.
public static bool SaveAs(this IGH_Structure gH_Structure);gH_Structure Grasshopper.Kernel.Data.IGH_Structure
The Grasshopper structure to evaluate for serializable objects and save.
System.Boolean
True if the file was successfully saved and exists on disk; otherwise, false.
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;T
The type of serializable object to extract. Must implement DiGi.Core.Interfaces.ISerializableObject.
gH_Structure Grasshopper.Kernel.Data.IGH_Structure
The Grasshopper structure to query for serializable objects.
System.Collections.Generic.List<T>
A list containing the found objects of type T, or null if the provided structure is null.
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);type System.Type
The System.Type for which the subcategory is being determined.
System.String
A string representing the subcategory of the type's assembly.
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);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.
System.Boolean
true if the "Value" property was found and successfully read; otherwise, false.
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);TObject
The expected type of the resulting value.
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.
System.Boolean
true if the object (or its wrapped value) is of type TObject; otherwise, false.
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;TSerializableObject
The expected type of the serializable object. Must implement DiGi.Core.Interfaces.ISerializableObject.
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.
System.Boolean
true if the value was successfully extracted and is of type TSerializableObject; otherwise, false.
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);gooSerializableObject IGooSerializableObject
The serializable object to extract the value from.
gooParam GooParam
The parameter definition used to identify the value.
System.Object
The extracted value if found; otherwise, null.
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);object System.Object
The object to inspect.
gooParam GooParam
The parameter definition used to identify the value.
System.Object
The extracted value if found; otherwise, null.
public static class SettingsInheritance System.Object → Settings
Gets the global instance of the InspectManager.
public static DiGi.Rhino.Core.Classes.InspectManager InspectManager { get; }