BakeKey

References
public sealed class BakeKey : IEquatable<BakeKey>, IComparable<BakeKey>
A small collection of values used to identify baked objects.

Constructors

BakeKey

#
Create a new bake key.
public BakeKey(
name,
Process name of bake.
guid,
Process id of bake.
twig,
Twig inex.
item,
Item index.
part
Part index. Leave at -1 to automatically set during bake
)

Fields

BakeItemIndex

#
Key under which the bake item index is stored. Not all baked objects necessarily have this data.
public const string BakeItemIndex = "G2Item"

BakeObjectGuid

#
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.
public const string BakeObjectGuid = "G2ObjGuid"

BakeObjectHash

#
Key under which the original DataCRC of a baked object is stored in the geometry UserDictionary.
public const string BakeObjectHash = "G2ObjHash"

BakePartIndex

#
Key under which the bake part index is stored. Not all baked objects necessarily have this data.
public const string BakePartIndex = "G2Part"

BakeProcessGuid

#
Key under which the bake process name is stored. Typically this is the IDocumentObject.InstanceId of the object which contained the baked data. Not all baked objects necessarily have this data.
public const string BakeProcessGuid = "G2ProcGuid"

BakeProcessName

#
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.
public const string BakeProcessName = "G2ProcName"

BakeTwigIndex

#
Key under which the bake twig index is stored. Not all baked objects necessarily have this data.
public const string BakeTwigIndex = "G2Twig"

Properties

IsEmpty

#
Gets whether this key is unset.
public bool IsEmpty { get; }

ItemIndex

#
Item index.
public int ItemIndex { get; }

PartIndex

#
Part index. This is needed when a single Grasshopper value baked to several Rhino shapes.
public int PartIndex { get; }

ProcessGuid

#
Key identifier. This typically refers to the IDocumentObject.InstanceId of the object which emitted the baked data.
public Guid ProcessGuid { get; }

ProcessName

#
Process name. This is usually empty for automatic bakes, but may be set by the user in the context of a structured baking process.
public string ProcessName { get; }

TwigIndex

#
Twig index.
public int TwigIndex { get; }

Methods

AssignToDictionary

#
Assign this bake key to a Rhino user dictionary.
public void AssignToDictionary()

AssignToObject

#
Assign this bake key to a baked object.
public void AssignToObject(
obj,
assignObjectGuid = true,
assignObjectHash = true
)

AssignToObject

#
Assign this bake key to a baked object.
public void AssignToObject(
obj,
assignObjectGuid = true,
assignObjectHash = true
)

CompareTo

#
public int CompareTo(
other
)

Equals

#
public bool Equals(
other
)

Equals

#
public override bool Equals(
obj
)
Object.Equals

GetHashCode

#
public override int GetHashCode()

HarvestFromDictionary

#
Harvest the bake key stored on a Rhino dictionary.
public static BakeDataState HarvestFromDictionary(
dictionary,
Dictionary to harvest from.
out BakeKey
key
Harvested key.
)
State of bake data on the object.

HarvestFromObject

#
Harvest the bake key stored on a Rhino object. The key is harvested for every state other than BakeDataState.None; the returned state merely describes how trustworthy it is.
public static BakeDataState HarvestFromObject(
obj,
Object to harvest from.
out BakeKey
key
Harvested key.
)
State of bake data on the object.

HarvestFromObject

#
Harvest the bake key stored on a Rhino object. The key is harvested for every state other than BakeDataState.None; the returned state merely describes how trustworthy it is.
public static BakeDataState HarvestFromObject(
obj,
Object to harvest from.
out BakeKey
key
Harvested key.
)
State of bake data on the object.

ToString

#
public override string ToString()
Object.ToString

WithGuid

#
Modify the ProcessGuid field of this key.
public BakeKey WithGuid(
guid
)

WithIndices

#
Modify the indices of this key.
public BakeKey WithIndices(
twig,
item,
part
)

WithItem

#
Modify the ItemIndex field of this key.
public BakeKey WithItem(
item
)

WithPart

#
Modify the PartIndex field of this key.
public BakeKey WithPart(
part
)

WithTwig

#
Modify the ItemIndex field of this key.
public BakeKey WithTwig(
twig
)

Operators

OperationResultDescription
BakeKey==BakeKeybool
BakeKey!=BakeKeybool