Click or drag to resize

HatchPatternTableItem Property

Conceptually, the hatch pattern table is an array of hatch patterns. The operator[] can be used to get individual hatch patterns. A hatch pattern is either active or deleted and this state is reported by HatchPattern.IsDeleted.

Namespace:  Rhino.DocObjects.Tables
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public HatchPattern this[
	int index
] { get; }

Parameters

index
Type: SystemInt32
zero based array index.

Return Value

Type: HatchPattern
If index is out of range, the current hatch pattern is returned.
Remarks
Detaching a worksession reference model, or purging a linked instance definition, removes its hatch patterns but leaves the table slots they occupied empty; the slots cannot be closed up, because table indices are persistent references that objects store. Count spans the empty slots and they accumulate for the life of the document. An index that lands on one returns the default hatch pattern rather than throwing, and nothing about it says it is a stand-in except its index, which is -1 and never the index you asked for - so test index == HatchPatterns[index].Index before treating an entry as real. Enumerating the table with foreach goes through the document manifest rather than the raw table array, so it does not visit empty slots at all. See RH-97389.
See Also