GH_Path
Describes the path in structure space of a data item or a list of items. A path consists of a series of integers, each one of which represents an index in a branch structure.
Inheritance Hierarchy
System.Object
Grasshopper.Kernel.Data.GH_Path
Namespace: Grasshopper.Kernel.Data
Assembly: Grasshopper (in Grasshopper.dll)
Syntax
public class GH_Path : IComparable<GH_Path>, IComparer<GH_Path>, GH_ISerializable
The GH_Path type exposes the following members.
Constructors
Name
Description
Public Method
GH_Path.
Default constructor, creates a path with zero elements.
Public Method
GH_Path(GH_Path)
Creates an exact copy of another path.
Public Method
GH_Path(Int32)
Creates a new path with a single element.
Public Method
GH_Path(.Int32.)
Creates a new path from a series of elements.
Properties
Name
Description
Public Property
Indices
Gets or sets the entire index space; the path that identifies an element in structure space. You should not change the index space when the path is used inside a structure since it will invalidate the sort order. If you don’t know what you’re doing, for Pete’s sake don’t touch this.
Public Property
Length
Returns the number of dimensions in the path.
Public Property
Valid
Gets whether this path is valid. Invalid paths either have no elements or negative elements.
Methods
Name
Description
Public Method
AppendElement
Create a new path by appending a new index value to this path.
Public Method
Compare
Compare two paths. This function determines the Sorting behaviour of paths.
Public Method
CompareTo
Compare this path to another path. This function determines the Sorting behaviour of paths.
Public Method
CullElement
Removes the last index value from the path. If the path is already empty, nothing will happen.
Public Method
CullFirstElement
Removes the first index value from the path. If the path is already empty, nothing will happen.
Public Method
Format
Format a path.
Public Method
FromString
Try to deserialize a GH_Path from a String.
Public Method
GetHashCode
Specialized Hash code pattern.
(Overrides Object.GetHashCode..)
Public Method
Increment(Int32)
Increment a specific index in this path by one.
Public Method
Increment(Int32, Int32)
Increment a specific index in this path by one.
Public Method
IsAncestor
Test another path to see if it is an ancestor of this path. For a path to be considered an ancestor, it must share the initial dimensions.
Public Method
IsCoincident(GH_Path)
Test to see if this path is coincident with another path.
Public Method
IsCoincident(.Int32.)
Test to see if this path is coincident with set of integers.
Public Method
PrependElement
Create a new path by prepending a new index value to this path.
Public Method
Read
Read this path from an archive.
Public Method
Static Member
SplitPathLikeString
Try to split up a path-like formatted string “{A;B;C}(i)” into component parts.
Public Method
ToString.
Concatenates the indices in the path.
(Overrides Object.ToString..)
Public Method
ToString(Boolean)
Concatenates the indices in the path.
Public Method
Write
Write this path to an archive.
Operators
Name
Description
Public Operator
Static Member
Equality
Public Operator
Static Member
GreaterThan
Public Operator
Static Member
Inequality
Public Operator
Static Member
LessThan