GH_StateServer

List<1>References
Maintains all the recorded states for this document.

Constructors

GH_StateServer

#
public GH_StateServer(GH_Document owner)
owner (GH_Document)

Properties

Names

#
public List<string> Names { get; }
Gets a list of all the state names in this server.

Owner

#
public GH_Document Owner { get; }
Gets the document that owns this server.

Methods

NewStateFromDocument

#
public GH_State NewStateFromDocument()
Displays UI for new state creation. If the user aborts, then null is returned. If the user successfully defines a new state, it is appended to this server.

Read

#
public bool Read(GH_IReader reader)
reader (GH_IReader)
Read

RemoveState

#
public bool RemoveState(int index)
Remove a certain state. This method adds an undo record to the document.
index (int)Index of state to remove.
True on success, false on failure.

RestoreState

#
public bool RestoreState(int index, bool recompute, ref int restored_objects, ref int missing_objects)
Restore a certain state.
index (int)Index of state to restore.
recompute (bool)If True, a new solution will be started right away.
restored_objects (ref int)Number of objects successfully restored.
missing_objects (ref int)Number of objects that could not be found.
True on success, false on failure.

RestoreState

#
public bool RestoreState(int index, ref int restored_objects, ref int missing_objects)
Restore a certain state.
index (int)Index of state to restore.
restored_objects (ref int)Number of objects successfully restored.
missing_objects (ref int)Number of objects that could not be found.
True on success, false on failure.

RestoreState

#
public bool RestoreState(string name, ref int restored_objects, ref int missing_objects)
Restore a certain state.
name (string)Name of state to restore. Name is case-sensitive.
restored_objects (ref int)Number of objects successfully restored.
missing_objects (ref int)Number of objects that could not be found.
True on success, false on failure.

Write

#
public bool Write(GH_IWriter writer)
writer (GH_IWriter)
Write