BakeKey

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

Constructors

BakeKey

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

Fields

BakeItemIndex

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

BakeObjectGuid

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

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

BakePartIndex

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

BakeProcessGuid

#
public const string BakeProcessGuid = "G2ProcGuid"
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.

BakeProcessName

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

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

Properties

IsEmpty

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

ItemIndex

#
public int ItemIndex { get; }
Item index.

PartIndex

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

ProcessGuid

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

ProcessName

#
public string ProcessName { get; }
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

#
public int TwigIndex { get; }
Twig index.

Methods

AssignToDictionary

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

AssignToObject

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

AssignToObject

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

CompareTo

#
public int CompareTo(BakeKey other)
other (BakeKey)

Equals

#
public bool Equals(BakeKey other)
other (BakeKey)

Equals

#
public override bool Equals(object obj)
obj (object)
Object.Equals

GetHashCode

#
public override int GetHashCode()

HarvestFromDictionary

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

HarvestFromObject

#
public static BakeDataState HarvestFromObject(File3dmObject obj, out BakeKey key)
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.
obj (File3dmObject)Object to harvest from.
key (out BakeKey)Harvested key.
State of bake data on the object.

HarvestFromObject

#
public static BakeDataState HarvestFromObject(RhinoObject obj, out BakeKey key)
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.
obj (RhinoObject)Object to harvest from.
key (out BakeKey)Harvested key.
State of bake data on the object.

ToString

#
public override string ToString()
Object.ToString

WithGuid

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

WithIndices

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

WithItem

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

WithPart

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

WithTwig

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

Operators

OperationResultDescription
BakeKey==BakeKeybool
BakeKey!=BakeKeybool