# TypeFamily<T> class

Namespace: [Grasshopper2.Collections](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.collections.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class TypeFamily<T>
```

A collection of types with their associated IDs. This collection is designed to store a comprehensive list of all the implementations of a specific interface or base class for the purposes of (de)serialisation.

**Type parameters:**

- `T` (where IStorable)

## Properties

- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1/count.md): Gets the number of stored pairs.
- [Identifiers](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1/identifiers.md): Iterate over all type identifiers.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1/item.md): Gets the type associated with the given ID.

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1/add.md): (2 overloads) Add an id/type pair to this collection.
- [AddRange](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1/addrange.md): (2 overloads) Add a bunch of id/type pairs to this collection.
- [HasGuid](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1/hasguid.md): Test whether a GUID is already part of this list.
- [HasType](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1/hastype.md): Test whether a GUID is already part of this list.
- [Instantiate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1/instantiate.md): Construct an instance of one of the types. This method either throws or returns a constructed instance.
- [TryInstantiate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1/tryinstantiate.md): Try to construct an instance of one of the types.
