Transaction Events
The TransactionUndo event notifies the client when an undo operation is performed. _Pre fires before and _Post after the transaction is undone.
EventNames:
TransactionUndo_Pre
TransactionUndo_Post
Examples:
TransactionUndo_Pre:
Register-InventorEvent -EventName TransactionUndo_Pre -Action 'PreTransactionUndo'
function PreTransactionUndo() {
#Write event code here
}
TransactionUndo_Post:
Register-InventorEvent -EventName TransactionUndo_Post -Action 'PostTransactionUndo'
function PostTransactionUndo() {
#Write event code here
}
The TransactionRedo event notifies the client when a redo operation is performed. _Pre fires before and _Post after the transaction is redone.
EventNames:
TransactionRedo_Pre
TransactionRedo_Post
Examples:
TransactionRedo_Pre:
Register-InventorEvent -EventName TransactionRedo_Pre -Action 'PreTransactionRedo'
function PreTransactionRedo() {
#Write event code here
}
TransactionRedo_Post:
Register-InventorEvent -EventName TransactionRedo_Post -Action 'PostTransactionRedo'
function PostTransactionRedo() {
#Write event code here
}
The TransactionCommit event notifies the client when a transaction is committed. A transaction is an operation the user can undo; when it is committed, the operation is completed and put on the transaction stack, from where it can be undone. _Pre fires before and _Post after the transaction is committed.
EventNames:
TransactionCommit_Pre
TransactionCommit_Post
Examples:
TransactionCommit_Pre:
Register-InventorEvent -EventName TransactionCommit_Pre -Action 'PreTransactionCommit'
function PreTransactionCommit() {
#Write event code here
}
TransactionCommit_Post:
Register-InventorEvent -EventName TransactionCommit_Post -Action 'PostTransactionCommit'
function PostTransactionCommit() {
#Write event code here
}
The TransactionAbort event notifies the client when a transaction is aborted. This happens when a command has started a transaction and performed operations within it, but decides to abort the process instead of committing it. _Pre fires before and _Post after the transaction is aborted.
EventNames:
TransactionAbort_Pre
TransactionAbort_Post
Remarks:
An abort can happen in the case where a command has started a transaction and performed operations within that transaction but decides to abort the process rather than commit it.
Examples:
TransactionAbort_Pre:
Register-InventorEvent -EventName TransactionAbort_Pre -Action 'PreTransactionAbort'
function PreTransactionAbort() {
#Write event code here
}
TransactionAbort_Post:
Register-InventorEvent -EventName TransactionAbort_Post -Action 'PostTransactionAbort'
function PostTransactionAbort() {
#Write event code here
}
The TransactionDelete event notifies the client after a transaction was deleted from the transaction stack (the list of all transactions that can be undone or redone). Only _Post is available.
Transactions are deleted when the stack exceeds its maximum size (the oldest transactions are removed and can no longer be undone), when a new transaction is committed after other transactions were undone (the undone transactions can no longer be redone), and when a document is closed (the whole stack is cleared).
EventNames:
TransactionDelete_Post
Remarks:
The transaction stack contains a list of all transactions that can be undone or redone. Transactions are deleted as the result of three things. First, the transaction stack has a fixed number of transactions it can hold, (which is defined in the registry). When the number of transactions goes over this limit, the transactions at the bottom of the stack are deleted. This means they can no longer be undone. The second reason a transaction is deleted is when a transaction is undone and then another transaction is committed. All transactions in the undone state are deleted and can’t be redone. The third reason is as a result of a document being closed. Whenever a document is closed the entire transaction stack is cleared. All transactions in the stack will be deleted.
Examples:
TransactionDelete_Post:
Register-InventorEvent -EventName TransactionDelete_Post -Action 'PostTransactionDelete'
function PostTransactionDelete() {
#Write event code here
}