Provides access to layers in the 3dm file.

Properties

ComponentType

#Since v6.0
public override ModelComponentType ComponentType { get; }

Count

Returns the count of all items, including deleted ones.
public virtual int Count { get; }
inherited fromCommonComponentTable<T>

Methods

Add

Adds an item.
public virtual void Add(
T
item
The item to add.
)
inherited fromFile3dmCommonComponentTable<T>

AddDefaultLayer

#Since v7.30
Easy way to add a default layer to the model.
public int AddDefaultLayer(
name,
Layer name.
color
Layer color.
)
Remarks: Note, the layer name will be modified as needed in the model and manifest.
The layer's index (>=0) is returned. Otherwise, RhinoMath.UnsetIntIndex is returned.

AddLayer

#Since v7.30
Add a new layer to the model.
public int AddLayer(
name,
Layer name.
color,
Layer color.
parentId
The id of the parent layer, can be Guid.Empty.
)
The layer's index (>=0) is returned. Otherwise, RhinoMath.UnsetIntIndex is returned.

AddLayer

#Since v7.6
Easy way to add a new layer to the model.
public int AddLayer(
name,
Layer name.
color
Layer color.
)
Remarks: Note, the layer name will be modified as needed in the model and manifest.
The layer's index (>=0) is returned. Otherwise, RhinoMath.UnsetIntIndex is returned.

Clear

Marks all items as deleted.
public void Clear()
inherited fromCommonComponentTable<T>

Delete

Flags a component as deleted.
public override bool Delete(
T
item
The item to flag.
)
inherited fromFile3dmCommonComponentTable<T>
True on success.

Delete

Flags a component as deleted.
public virtual void Delete(
index
The index of the item to flag.
)
inherited fromFile3dmCommonComponentTable<T>
True on success.

Dump

Prepares a text dump of object table.
public string Dump()
inherited fromFile3dmCommonComponentTable<T>
A string containing the dump.

FindId

Uses the guid to find a model component. Deleted objects cannot be found by id. The guid is the value that is stored in the .Id property. In a single document, no two active objects have the same guid. If an object is replaced with a new object, then the guid persists. For example, if the _Move command moves an object, then the moved object inherits its guid from the starting object. If the Copy command copies an object, then the copy gets a new guid. This guid persists through file saving/opening operations. This function will not find grip objects.
public virtual T FindId(
id
ID of model component to search for.
)
inherited fromCommonComponentTable<T>
Reference to the rhino object with the objectId or null if no such object could be found.
FindId

FindIndex

#Since v6.0
Retrieves a Layer object based on Index. This search type of search is discouraged. We are moving towards using only IDs for all tables.
public Layer FindIndex(
index
The index to search for.
)
A Layer object, or null if none was found.

FindName

#Since v6.0
Finds a Layer given its name.
public Layer FindName(
name,
The name of the Layer to be searched.
parentId
The id of the parent Layer to be searched.
)
A Layer, or null on error.

FindNameHash

#Since v6.0
Finds a Layer given its name hash.
public Layer FindNameHash(
nameHash
The name hash of the Layer to be searched.
)
An Layer, or null on error.

GetEnumerator

Returns the enumerator that yields all items.
public virtual IEnumerator<T> GetEnumerator()
inherited fromCommonComponentTable<T>