NamedLayerStateTable

References
public sealed class NamedLayerStateTable
All named layer states in a Rhino document.

Properties

Count

#Since v6.14
public int Count { get; }
Returns the number of named layers states in the document.

Document

#Since v6.14
public RhinoDoc Document { get; }
Document that owns this table.

Names

#Since v6.14
public string[] Names { get; }
Returns the names of named layer states in the document.

Methods

Delete

#Since v6.14
public bool Delete(string name)
Deletes an existing named layer state.
name (string)The name of the layer state.
True if successful, false otherwise.

FindName

#Since v6.14
public int FindName(string name)
Returns the index of an existing named layer state.
name (string)The name of the layer state.
>0 if successful, -1 if not found.

Import

#Since v6.15
public int Import(string filename)
Imports named layer states from a 3dm file.
filename (string)The name of the file to import.
The number of named layers states imported.

Rename

#Since v6.14
public bool Rename(string oldName, string newName)
Renames an existing named layer state.
oldName (string)The name of the layer state.
newName (string)The new name
True if successful, false otherwise.

Restore

#Since v6.14
[CLSCompliant(false)] public bool Restore(string name, RestoreLayerProperties properties, Guid viewportId)
Restores a named layer state.
name (string)The name of the layer state.
properties (RestoreLayerProperties)The layer properties to restore.
viewportId (Guid)The id of the layout or detail viewport to restore the per-viewport layer properties.

Restore

#Since v6.14
[CLSCompliant(false)] public bool Restore(string name, RestoreLayerProperties properties)
Restores a named layer state.
name (string)The name of the layer state.
properties (RestoreLayerProperties)The layer properties to restore.
True if successful, false otherwise.

Save

#Since v6.14
public int Save(string name, Guid viewportId)
Saves or updates a named layer state.
name (string)The name of the layer state. If the named layer state already exists, it will be updated.
viewportId (Guid)The id of the layout or detail viewport, required to save per viewport layer state properties.
The index of the newly added, or updated, layer state.

Save

#Since v6.14
public int Save(string name)
Saves or updates a named layer state.
name (string)The name of the layer state. If the named layer state already exists, it will be updated.
The index of the newly added, or updated, layer state.