# BakeKey class

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

```cs
public sealed class BakeKey : IEquatable<BakeKey>, IComparable<BakeKey>
```

A small collection of values used to identify baked objects.

## Constructors

- [BakeKey](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/ctor.md): Create a new bake key.

## Fields

- [BakeItemIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/bakeitemindex.md): (static) Key under which the bake item index is stored. Not all baked objects necessarily have this data.
- [BakeObjectGuid](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/bakeobjectguid.md): (static) Key under which the original ID of a baked object is stored in the UserDictionary. This allows Grasshopper to figure out later whether an object with bake data was the one originally baked, or whether it was a copy.
- [BakeObjectHash](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/bakeobjecthash.md): (static) Key under which the original DataCRC of a baked object is stored in the geometry UserDictionary.
- [BakePartIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/bakepartindex.md): (static) Key under which the bake part index is stored. Not all baked objects necessarily have this data.
- [BakeProcessGuid](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/bakeprocessguid.md): (static) Key under which the bake process name is stored. Typically this is the [IDocumentObject.InstanceId](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.idocumentobject/instanceid.md) of the object which contained the baked data. Not all baked objects necessarily have this data.
- [BakeProcessName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/bakeprocessname.md): (static) Key under which the bake process name is stored. This is typically only assigned when the user specifies a bake process name. Not all baked objects necessarily have this data.
- [BakeTwigIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/baketwigindex.md): (static) Key under which the bake twig index is stored. Not all baked objects necessarily have this data.

## Properties

- [IsEmpty](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/isempty.md): Gets whether this key is unset.
- [ItemIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/itemindex.md): Item index.
- [PartIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/partindex.md): Part index. This is needed when a single Grasshopper value baked to several Rhino shapes.
- [ProcessGuid](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/processguid.md): Key identifier. This typically refers to the [IDocumentObject.InstanceId](https://developer.rhino3d.com/api/gh2/type/grasshopper2.doc.idocumentobject/instanceid.md) of the object which emitted the baked data.
- [ProcessName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/processname.md): Process name. This is usually empty for automatic bakes, but may be set by the user in the context of a structured baking process.
- [TwigIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/twigindex.md): Twig index.

## Methods

- [AssignToDictionary](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/assigntodictionary.md): Assign this bake key to a Rhino user dictionary.
- [AssignToObject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/assigntoobject.md): (2 overloads) Assign this bake key to a baked object.
- [CompareTo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/compareto.md)
- [Equals](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/equals.md): (2 overloads)
- [GetHashCode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/gethashcode.md)
- [HarvestFromDictionary](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/harvestfromdictionary.md): (static) Harvest the bake key stored on a Rhino dictionary.
- [HarvestFromObject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/harvestfromobject.md): (2 overloads, static) Harvest the bake key stored on a Rhino object. The key is harvested for every state other than [BakeDataState.None](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakedatastate.md); the returned state merely describes how trustworthy it is.
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/tostring.md)
- [WithGuid](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/withguid.md): Modify the [BakeKey.ProcessGuid](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/processguid.md) field of this key.
- [WithIndices](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/withindices.md): Modify the indices of this key.
- [WithItem](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/withitem.md): Modify the [BakeKey.ItemIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/itemindex.md) field of this key.
- [WithPart](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/withpart.md): Modify the [BakeKey.PartIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/partindex.md) field of this key.
- [WithTwig](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/withtwig.md): Modify the [BakeKey.ItemIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/itemindex.md) field of this key.

## Operators

- [operator ==](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/op-equality.md): (static)
- [operator !=](https://developer.rhino3d.com/api/gh2/type/grasshopper2.bake.bakekey/op-inequality.md): (static)
