Click or drag to resize

MarkupTableItem Property

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

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

Parameters

index
Type: SystemInt32
zero based array index.

Return Value

Type: Markup
Reference to the markup. If index is out of range, null is returned. Note this reference may become invalid after AddMarkup() is called.
Remarks

Detaching a worksession reference model, or purging a linked instance definition, removes its markups 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 - one per purge.

An index that lands on an empty slot returns a Markup that throws DocumentCollectedException on every property access, so code that walks this table by index must expect it. To tell a real markup from an empty slot, compare the index you asked for with Markup.Index: an empty slot never reports the index you asked for. 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 and is the safer way to walk the table. See RH-97389.

See Also