# Presets<T> class

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

```cs
[IoId("00000000-7afb-41e0-b4e1-4c489e4646ee")]
public sealed class Presets<T> : IPresets
```

Generic implementation of IPresets.

**Type parameters:**

- `T`

## Constructors

- [Presets<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/ctor.md): (2 overloads) Empty preset constructor.

## Properties

- [AllPresets](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/allpresets.md): Enumerate over all name+value pairs.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/count.md): Gets the number of preset values.
- [IPresets.AllPresets](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/grasshopper2-parameters-ipresets-allpresets.md)
- [Names](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/names.md): Enumerate over all names.

## Indexers

- [IPresets.this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/grasshopper2-parameters-ipresets-this.md): (2 overloads)
- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/item.md): (2 overloads) Access a specific name+value pair.

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/add.md): (3 overloads) Attempt to add a preset.
- [AddEnum<TE>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/addenum.md): Add all values from an enum as presets. This will only work if the enum numeric base type is compatible with the T constraint. The values are added under their own name, unless they have a [UiName] attribute.
- [AddEnumByType](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/addenumbytype.md): Add all values from an enum as presets. This will only work if the enum numeric base type is compatible with the T constraint. The values are added under their own name, unless they have a [UiName] attribute.
- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/clear.md): Wipe all defined presets.
- [FindByValue](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/findbyvalue.md): Attempt to find the name of a value. If the value is of the wrong type or otherwise unknown to this preset collection, null or an empty string may be returned.
- [IPresets.FindByValue](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/grasshopper2-parameters-ipresets-findbyvalue.md)
- [IPresets.TryCopyFrom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/grasshopper2-parameters-ipresets-trycopyfrom.md)
- [IsAvailable](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/isavailable.md): Gets whether a specific name is still available and adheres to the naming scheme.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/store.md)
- [TryCopyFrom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.presets-1/trycopyfrom.md): Try and copy all presets from another collection.
