GH_Document.GH_UndoUtil

References
This class is emitted by the Undo property of a GH_Document instance.

Methods

CreateAddObjectEvent

#
public GH_UndoRecord CreateAddObjectEvent(string name, IEnumerable<IGH_DocumentObject> objs)
Create a new undo record for a bunch of object additions.
name (string)Name of undo record.
objs (IEnumerable<IGH_DocumentObject>)Objects to be added.
A newly created undo record.

CreateAddObjectEvent

#
public GH_UndoRecord CreateAddObjectEvent(string name, IGH_DocumentObject obj)
Create a new undo record for a single object addition.
name (string)Name of undo record.
obj (IGH_DocumentObject)Object to be added.
A newly created undo record.

CreateAddStateEvent

#
public GH_UndoRecord CreateAddStateEvent(string name, int stateIndex, GH_State state)
Create a new undo record for a single solution state addition.
name (string)Name of undo record.
stateIndex (int)Index of state.
state (GH_State)Solution state.
A newly created undo record.

CreateEnabledEvent

#
public GH_UndoRecord CreateEnabledEvent(string name, IGH_ActiveObject obj)
Create a new undo record for an object enabled change. This function must be called before the enabled flag is changed.
name (string)Name of undo record.
obj (IGH_ActiveObject)Target object for undo record.
A newly created undo record.

CreateGenericObjectEvent

#
public GH_UndoRecord CreateGenericObjectEvent(string name, IGH_DocumentObject obj)
Create a new undo record for a generic, single object change.
name (string)Name of undo record.
obj (IGH_DocumentObject)Object to be recorded.
A newly created undo record.

CreateLayoutEvent

#
public GH_UndoRecord CreateLayoutEvent(string name, IEnumerable<IGH_DocumentObject> objs)
Create a new undo record for a bunch of object layout changes. This function must be called before the layouts are changed.
name (string)Name of undo record.
objs (IEnumerable<IGH_DocumentObject>)Target objects for undo record.
A newly created undo record.

CreateLayoutEvent

#
public GH_UndoRecord CreateLayoutEvent(string name, IGH_DocumentObject obj)
Create a new undo record for a single object layout change. This function must be called before the layout is changed.
name (string)Name of undo record.
obj (IGH_DocumentObject)Target object for undo record.
A newly created undo record.

CreateNickNameEvent

#
public GH_UndoRecord CreateNickNameEvent(string name, IGH_DocumentObject obj)
Create a new undo record for an object nickname change. This function must be called before the nickname is changed.
name (string)Name of undo record.
obj (IGH_DocumentObject)Target object for undo record.
A newly created undo record.

CreatePersistentDataEvent<T>

#
public GH_UndoRecord CreatePersistentDataEvent<T>(string name, GH_PersistentParam<T> obj)
Create a new undo record for a single object persistent data change.
name (string)Name of undo record.
obj (GH_PersistentParam<T>)Object to be recorded.
A newly created undo record.

CreatePivotEvent

#
public GH_UndoRecord CreatePivotEvent(string name, IEnumerable<IGH_DocumentObject> objs)
Create a new undo record for a bunch of pivot changes. This function must be called before the pivots are changed.
name (string)Name of undo record.
objs (IEnumerable<IGH_DocumentObject>)Target objects for undo record.
A newly created undo record.

CreatePivotEvent

#
public GH_UndoRecord CreatePivotEvent(string name, IGH_DocumentObject obj)
Create a new undo record for a single pivot change. This function must be called before the pivot is changed.
name (string)Name of undo record.
obj (IGH_DocumentObject)Target object for undo record.
A newly created undo record.

CreatePreviewEvent

#
public GH_UndoRecord CreatePreviewEvent(string name, IGH_ActiveObject obj)
Create a new undo record for an object preview change. This function must be called before the preview is changed.
name (string)Name of undo record.
obj (IGH_ActiveObject)Target object for undo record.
A newly created undo record.

CreateRemoveObjectEvent

#
public GH_UndoRecord CreateRemoveObjectEvent(string name, IEnumerable<IGH_DocumentObject> objs)
Create a new undo record for a bunch of object removals.
name (string)Name of undo record.
objs (IEnumerable<IGH_DocumentObject>)Objects to be removed.
A newly created undo record.

CreateRemoveObjectEvent

#
public GH_UndoRecord CreateRemoveObjectEvent(string name, IGH_DocumentObject obj)
Create a new undo record for a single object removal.
name (string)Name of undo record.
obj (IGH_DocumentObject)Object to be removed.
A newly created undo record.

CreateRemoveStateEvent

#
public GH_UndoRecord CreateRemoveStateEvent(string name, int stateIndex, GH_State state)
Create a new undo record for a single solution state removal.
name (string)Name of undo record.
stateIndex (int)Index of state.
state (GH_State)Solution state.
A newly created undo record.

CreateReplaceStateEvent

#
public GH_UndoRecord CreateReplaceStateEvent(string name, int stateIndex, GH_State oldState, GH_State newState)
Create a new undo record for a single solution state addition.
name (string)Name of undo record.
stateIndex (int)Index of state.
oldState (GH_State)Solution state to remove.
newState (GH_State)Solution state to insert.
A newly created undo record.

CreateWireEvent

#
public GH_UndoRecord CreateWireEvent(string name, IEnumerable<IGH_Param> params)
Create a new undo record for a set of Connector wire changes. This function must be called before the wires are changed.
name (string)Name of undo record.
params (IEnumerable<IGH_Param>)Target parameters for undo record.
A newly created undo record.

CreateWireEvent

#
public GH_UndoRecord CreateWireEvent(string name, IGH_Param param)
Create a new undo record for a set of Connector wire changes. This function must be called before the wires are changed.
name (string)Name of undo record.
param (IGH_Param)Target object for undo record.
A newly created undo record.

MergeRecords

#
public bool MergeRecords(int count)
Attempt to merge the N most recent records into one. The name of the merged record will be identical to the name of the oldest record.
count (int)Number of most recent records to merge.
True if merge was successful.

RecordAddObjectEvent

#
public Guid RecordAddObjectEvent(string name, IEnumerable<IGH_DocumentObject> objs)
Create and Record a new ObjectAdded undo record.
name (string)Name of undo record.
objs (IEnumerable<IGH_DocumentObject>)Target objects for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordAddObjectEvent

#
public Guid RecordAddObjectEvent(string name, IGH_DocumentObject obj)
Create and Record a new ObjectAdded undo record.
name (string)Name of undo record.
obj (IGH_DocumentObject)Target object for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordAddStateEvent

#
public Guid RecordAddStateEvent(string name, int stateIndex, GH_State state)
Create and Record a new CreateAddStateEvent undo record.
name (string)Name of undo record.
stateIndex (int)Index of state.
state (GH_State)Solution state.
The ID of the newly added undo record or Guid.Empty on failure.

RecordEnabledEvent

#
public Guid RecordEnabledEvent(string name, IGH_ActiveObject obj)
Create and Record a new EnabledChanged undo record.
name (string)Name of undo record.
obj (IGH_ActiveObject)Target object for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordEvent

#
public Guid RecordEvent(GH_UndoRecord record)
Add a new record to the undo stack of the owner document.
record (GH_UndoRecord)Undo record to add.
The ID of the newly added undo record or Guid.Empty on failure.

RecordEvent

#
public Guid RecordEvent(string name, IEnumerable<IGH_UndoAction> actions)
Add a new record to the undo stack of the owner document.
name (string)Name of undo record.
actions (IEnumerable<IGH_UndoAction>)Undo actions.
The ID of the newly added undo record or Guid.Empty on failure.

RecordEvent

#
public Guid RecordEvent(string name, IGH_UndoAction action)
Add a new record to the undo stack of the owner document.
name (string)Name of undo record.
action (IGH_UndoAction)Undo action.
The ID of the newly added undo record or Guid.Empty on failure.

RecordEvent

#
public Guid RecordEvent(string name, params IGH_UndoAction[] actions)
Add a new record to the undo stack of the owner document.
name (string)Name of undo record.
actions (params IGH_UndoAction[])Undo actions.
The ID of the newly added undo record or Guid.Empty on failure.

RecordGenericObjectEvent

#
public Guid RecordGenericObjectEvent(string name, IGH_DocumentObject obj)
Create and Record a new ObjectChanged undo record.
name (string)Name of undo record.
obj (IGH_DocumentObject)Target object for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordLayoutEvent

#
public Guid RecordLayoutEvent(string name, IEnumerable<IGH_DocumentObject> objs)
Create and Record a new LayoutChanged undo record.
name (string)Name of undo record.
objs (IEnumerable<IGH_DocumentObject>)Target objects for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordLayoutEvent

#
public Guid RecordLayoutEvent(string name, IGH_DocumentObject obj)
Create and Record a new LayoutChanged undo record.
name (string)Name of undo record.
obj (IGH_DocumentObject)Target object for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordNickNameEvent

#
public Guid RecordNickNameEvent(string name, IGH_DocumentObject obj)
Create and Record a new NickNameChanged undo record.
name (string)Name of undo record.
obj (IGH_DocumentObject)Target object for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordPersistentDataEvent<T>

#
public Guid RecordPersistentDataEvent<T>(string name, GH_PersistentParam<T> obj)
Create and Record a new PersistentDataChanged undo record.
name (string)Name of undo record.
obj (GH_PersistentParam<T>)Target object for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordPivotEvent

#
public Guid RecordPivotEvent(string name, IEnumerable<IGH_DocumentObject> objs)
Create and Record a new PivotChanged undo record.
name (string)Name of undo record.
objs (IEnumerable<IGH_DocumentObject>)Target objects for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordPivotEvent

#
public Guid RecordPivotEvent(string name, IGH_DocumentObject obj)
Create and Record a new PivotChanged undo record.
name (string)Name of undo record.
obj (IGH_DocumentObject)Target object for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordPreviewEvent

#
public Guid RecordPreviewEvent(string name, IGH_ActiveObject obj)
Create and Record a new PreviewChanged undo record.
name (string)Name of undo record.
obj (IGH_ActiveObject)Target object for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordRemoveObjectEvent

#
public Guid RecordRemoveObjectEvent(string name, IEnumerable<IGH_DocumentObject> objs)
Create and Record a new ObjectRemoved undo record.
name (string)Name of undo record.
objs (IEnumerable<IGH_DocumentObject>)Target objects for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordRemoveObjectEvent

#
public Guid RecordRemoveObjectEvent(string name, IGH_DocumentObject obj)
Create and Record a new ObjectRemoved undo record.
name (string)Name of undo record.
obj (IGH_DocumentObject)Target object for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordRemoveStateEvent

#
public Guid RecordRemoveStateEvent(string name, int stateIndex, GH_State state)
Create and Record a new CreateRemoveStateEvent undo record.
name (string)Name of undo record.
stateIndex (int)Index of state.
state (GH_State)Solution state.
The ID of the newly added undo record or Guid.Empty on failure.

RecordReplaceStateEvent

#
public Guid RecordReplaceStateEvent(string name, int stateIndex, GH_State oldState, GH_State newState)
Create and Record a new CreateReplaceStateEvent undo record.
name (string)Name of undo record.
stateIndex (int)Index of state.
oldState (GH_State)Solution state to remove.
newState (GH_State)Solution state to insert.
The ID of the newly added undo record or Guid.Empty on failure.

RecordWireEvent

#
public Guid RecordWireEvent(string name, IEnumerable<IGH_Param> params)
Create and Record a new WiresChanged undo record.
name (string)Name of undo record.
params (IEnumerable<IGH_Param>)Target parameters for undo record.
The ID of the newly added undo record or Guid.Empty on failure.

RecordWireEvent

#
public Guid RecordWireEvent(string name, IGH_Param param)
Create and Record a new WiresChanged undo record.
name (string)Name of undo record.
param (IGH_Param)Target parameter for undo record.
The ID of the newly added undo record or Guid.Empty on failure.