# Node class

Namespace: [GrasshopperIO.DataBase](https://developer.rhino3d.com/api/gh2/namespace/grasshopperio.database.md) · Assembly: [GrasshopperIO](https://developer.rhino3d.com/api/gh2/assembly/grasshopperio.md)

```cs
[DebuggerDisplay("{Topology}")]
public sealed class Node : IBinary, ISml, IWriter, IReader, IEquatable<Node>
```

Nodes are the main organising entities in Grasshopper IO hierarchical dictionaries. Nodes may contain any number of uniquely named items, as well as any number of uniquely named child nodes. Nodes explicitly implement the [IWriter](https://developer.rhino3d.com/api/gh2/type/grasshopperio.iwriter.md) and [IReader](https://developer.rhino3d.com/api/gh2/type/grasshopperio.ireader.md) interfaces, which is how nodes are most commonly exposed to client code.

Nodes are not thread-safe, not even for reading, since lookups and the inflation of serialised child nodes modify internal state.

## Fields

- [IoVersionNumber](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/ioversionnumber.md): (static) Represents the current IO version. When a breaking change to the data layout of GrasshopperIO archives must be implemented, this version will increment. I'm guessing 255 breaking changes will suffice for the lifetime of the Grasshopper 2 project, but if need be 255 can indicate a larger versioning integers stored subsequently.
- [IoVersionSpec](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/ioversionspec.md): (static) Defines when the current version specificiation was made official.

## Properties

- [IReader.Name](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-ireader-name.md)
- [ItemCount](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/itemcount.md): Gets the number of items in this node.
- [Items](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/items.md): Iterate over all items in this node.
- [Name](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/name.md): Gets the location of this node.
- [NodeCount](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/nodecount.md): Gets the number of child nodes in this node.
- [Nodes](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/nodes.md): Iterate over all immediate child nodes.
- [Topology](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/topology.md): Gets the structural description of this node. This includes all child nodes, but not any item names.

## Methods

- [AddItem](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/additem.md): (2 overloads) Add a new item to this node. Item location must be unique.
- [AddNode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/addnode.md): Add a duplicate of a node to this node.
- [AddSerialisedNode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/addserialisednode.md): Add a child node from its binary form, as produced by IO.WriteNodeToByteArray, without deserialising it. The child takes the name stored in the bytes. The bytes are written verbatim when this node is written in binary form, and must not contain file paths, which are made relative to the location being written to. This method allows for speedups in repeated serialisation of the same data.
- [AllTypeIdentifiers](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/alltypeidentifiers.md): Collect all the type identifiers associated with IStorable types which have been stored in this node, and all its children and grand-children.
- [AreIndentical](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/areindentical.md): (static) Test two nodes for equality. This comparison tests both the location, children and items of the node.
- [Boolean](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/boolean.md): (2 overloads)
- [BooleanArray](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/booleanarray.md): (2 overloads)
- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/clear.md): Clear this node by removing all children and items.
- [Complex128](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/complex128.md): (2 overloads)
- [Create](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/create.md): (3 overloads, static) Create a loose, empty node.
- [DateTime](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/datetime.md): (2 overloads)
- [Decimal128](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/decimal128.md): (2 overloads)
- [EmitNode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/emitnode.md): Add a new child to this node. The node name+index may not collide with another child already part of this node.
- [EnumerateAndExecute](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/enumerateandexecute.md): Enumerate over all child nodes and items in this node and invoke a delegate for each.
- [Equals](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/equals.md): (2 overloads)
- [FilePath](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/filepath.md): (3 overloads)
- [FindChildren](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/findchildren.md): (2 overloads) Find all children with matching names. This includes immediate children, grand-children etc. Results are returned in a breadth-first manner.
- [FindDifferences](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/finddifferences.md): (static) Find the differences between two nodes.
- [FindItem](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/finditem.md): Get the value associated with the specified location.
- [FindNode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/findnode.md): Get the child with the specified name and index.
- [FindParents](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/findparents.md): (2 overloads) Find all parents with matching names. The nearest parent is returned first.
- [GetHashCode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/gethashcode.md): Gets the hash code for this node. Note that nodes are mutable and that this method is *not* threadsafe. You should never rely on node hashes if you suspect some thread other than the caller may be affecting this node or any of the child nodes. Also note that the hash does not include any of the messaging strings.
- [IBinary.Read](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-database-ibinary-read.md): Explicit implementation of ISerializable.Read. Use the static methods on the IO class to deserialize nodes correctly and with a minimum of effort.
- [IBinary.Write](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-database-ibinary-write.md): Explicit implementation of [IBinary.Write(BinaryWriter, WriteContext)](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.ibinary/write.md). Use the static methods on the IO class to serialize nodes correctly and with a minimum of effort.
- [ISml.Write](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-database-isml-write.md): Explicit implementation of [IBinary.Write(BinaryWriter, WriteContext)](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.ibinary/write.md). Use the static methods on the IO class to serialize nodes correctly and with a minimum of effort.
- [IReader.FindReader](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-ireader-findreader.md)
- [IReader.GenericArray<T>](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-ireader-genericarray.md)
- [IReader.SupportsArray<T>](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-ireader-supportsarray.md)
- [IReader.TryRead<T>](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-ireader-tryread.md)
- [IWriter.CreateWriter](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-iwriter-createwriter.md)
- [IWriter.GenericArray<T>](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-iwriter-genericarray.md)
- [IWriter.SupportsArray<T>](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/grasshopperio-iwriter-supportsarray.md)
- [Guid128](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/guid128.md): (2 overloads)
- [GuidArray](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/guidarray.md): (2 overloads)
- [HasItem](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/hasitem.md): (2 overloads) Test to see whether an item with a specific name and index has been defined in this node.
- [HasItemOrNode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/hasitemornode.md): Gets whether the specified location is available as either an item or a node.
- [HasNode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/hasnode.md): Test to see whether a child with a specific name and index has been defined in this node.
- [Integer32](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/integer32.md): (2 overloads)
- [Integer32Array](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/integer32array.md): (2 overloads)
- [Integer64](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/integer64.md): (2 overloads)
- [Integer64Array](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/integer64array.md): (2 overloads)
- [Integer8](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/integer8.md): (2 overloads)
- [Integer8Array](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/integer8array.md): (2 overloads)
- [IntegerXx](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/integerxx.md): (2 overloads)
- [Number32](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/number32.md): (2 overloads)
- [Number32Array](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/number32array.md): (2 overloads)
- [Number64](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/number64.md): (2 overloads)
- [Number64Array](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/number64array.md): (2 overloads)
- [RemoveItem](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/removeitem.md): Remove an item from this node.
- [RemoveNode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/removenode.md): Remove a child from this node.
- [ReplaceItem](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/replaceitem.md): Replace an existing item, or add it if it doesn't exist yet.
- [Select](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/select.md): Try and find a node in this hierarchy.
- [Storable](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/storable.md): (3 overloads)
- [StorableArray<T>](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/storablearray.md): (2 overloads)
- [String](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/string.md): (2 overloads)
- [StringArray](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/stringarray.md): (2 overloads)
- [TimeSpan](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/timespan.md): (2 overloads)
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/tostring.md): Returns a string that represents the current object.
- [TryFindChild](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/tryfindchild.md): Try and find the child node which is reached via the given path.
- [TryFindParent](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/tryfindparent.md): Try and find the parent node which is reached via the given path.
- [Type](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/type.md): (3 overloads)
- [TypeName](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/typename.md)
- [Version](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.node/version.md): (2 overloads)
