Application Events
The ActivateDocument notifies the client when a document is activated.
Remarks
The active document is the top-level document that is being displayed in the active view. This means that in the case of editing a part inside an assembly, the active document will still be the assembly.
EventNames:
ActivateDocument_Pre
ActivateDocument_Post
Examples:
ActivateDocument_Pre:
Register-InventorEvent -EventName ActivateDocument_Pre -Action 'PreActivateDocument'
function PreActivateDocument() {
#Write event code here
}
ActivateDocument_Post:
Register-InventorEvent -EventName ActivateDocument_Post -Action 'PostActivateDocument'
function PostActivateDocument() {
#Write event code here
}
The ActivateView event notifies the client when a view is activated.
EventNames:
ActivateView_Post
Examples:
ActivateView_Post:
Register-InventorEvent -EventName ActivateView_Post -Action 'PostActivateView'
function PostActivateView() {
#Write event code here
}
The ActiveProjectChanged event notifies the client when the active project is changed.
EventNames:
ActiveProjectChanged_Pre
ActiveProjectChanged_Post
Parameters
Type |
Name |
Description |
|---|---|---|
String |
project |
Full file name of the project that has changed |
Examples:
ActiveProjectChanged_Pre:
Register-InventorEvent -EventName ActiveProjectChanged_Pre -Action 'PreActiveProjectChanged'
function PreActiveProjectChanged($project) {
#Write event code here
}
ActiveProjectChanged_Post:
Register-InventorEvent -EventName ActiveProjectChanged_Post -Action 'PostActiveProjectChanged'
function PostActiveProjectChanged($project) {
#Write event code here
}
The ApplicationOptionChange event notifies the client when the application options are modified.
EventNames:
ApplicationOptionChange_Pre
ApplicationOptionChange_Post
Examples:
ApplicationOptionChange_Pre:
Register-InventorEvent -EventName ApplicationOptionChange_Pre -Action 'PreApplicationOptionChange'
function PreApplicationOptionChange() {
#Write event code here
}
ApplicationOptionChange_Post:
Register-InventorEvent -EventName ApplicationOptionChange_Post -Action 'PostApplicationOptionChange'
function PostApplicationOptionChange() {
#Write event code here
}
The CloseDocument notifies the client when a document is closed
EventNames:
CloseDocument_Pre
CloseDocument_Post
Examples:
CloseDocument_Pre:
Register-InventorEvent -EventName CloseDocument_Pre -Action 'PreCloseDocument'
function PreCloseDocument() {
#Write event code here
}
CloseDocument_Post:
Register-InventorEvent -EventName CloseDocument_Post -Action 'PostCloseDocument'
function PostCloseDocument() {
#Write event code here
}
The CloseView event notifies the client when a view is closed.
EventNames:
CloseView_Pre
Examples:
CloseView_Pre:
Register-InventorEvent -EventName CloseView_Pre -Action 'PreCloseView'
function PreCloseView() {
#Write event code here
}
The DeactivateDocument event notifies the client when a document is deactivated.
EventNames:
DeactivateDocument_Pre
DeactivateDocument_Post
Examples:
DeactivateDocument_Pre:
Register-InventorEvent -EventName DeactivateDocument_Pre -Action 'PreDeactivateDocument'
function PreDeactivateDocument() {
#Write event code here
}
DeactivateDocument_Post:
Register-InventorEvent -EventName DeactivateDocument_Post -Action 'PostDeactivateDocument'
function PostDeactivateDocument() {
#Write event code here
}
The DisplayModeChange event notifies the client when the display mode of the view has changed.
EventNames:
DisplayModeChange_Pre
DisplayModeChange_Post
Examples:
DisplayModeChange_Pre:
Register-InventorEvent -EventName DisplayModeChange_Pre -Action 'PreDisplayModeChange'
function PreDisplayModeChange() {
#Write event code here
}
DisplayModeChange_Post:
Register-InventorEvent -EventName DisplayModeChange_Post -Action 'PostDisplayModeChange'
function PostDisplayModeChange() {
#Write event code here
}
The DocumentChange event notifies the client when the document is changed, supplying the reasons for change.
EventNames:
DocumentChange_Pre
DocumentChange_Post
Parameters
Type |
Name |
Description |
|---|---|---|
reasonsForChange |
This argument indicates the type of change that occurred. The value is from the CommandTypesEnum list, which represents the different categories of changes that can be made. Typically this will be a single value from the list but it can represent multiple values that have been combined together so you need to use bitwise operations to check for a specific change. |
Examples:
DocumentChange_Pre:
Register-InventorEvent -EventName DocumentChange_Pre -Action 'PreDocumentChange'
function PreDocumentChange() {
#Write event code here
}
DocumentChange_Post:
Register-InventorEvent -EventName DocumentChange_Post -Action 'PostDocumentChange'
function PostDocumentChange() {
#Write event code here
}
The InitializeDocument event notifies the client when a document is initialized.
EventNames:
InitializeDocument_Pre
InitializeDocument_Post
Examples:
InitializeDocument_Pre:
Register-InventorEvent -EventName InitializeDocument_Pre -Action 'PreInitializeDocument'
function PreInitializeDocument() {
#Write event code here
}
InitializeDocument_Post:
Register-InventorEvent -EventName InitializeDocument_Post -Action 'PostInitializeDocument'
function PostInitializeDocument() {
#Write event code here
}
The MigrateDocument event notifies the client when a document is being explicitly migrated.
Remarks
Explicit migration can happen in the following situations:
User selects the Migrate command through the User Interface
The document.Migrate method is called via the API on a document needing migration
A document needing migration is saved
EventNames:
MigrateDocument_Pre
MigrateDocument_Post
Examples:
MigrateDocument_Pre:
Register-InventorEvent -EventName MigrateDocument_Pre -Action 'PreMigrateDocument'
function PreMigrateDocument() {
#Write event code here
}
MigrateDocument_Post:
Register-InventorEvent -EventName MigrateDocument_Post -Action 'PostMigrateDocument'
function PostMigrateDocument() {
#Write event code here
}
The NewDocument event notifies the client whenever a new document is created.
EventNames:
NewDocument_Pre
NewDocument_Post
Examples:
NewDocument_Pre:
Register-InventorEvent -EventName NewDocument_Pre -Action 'PreNewDocument'
function PreNewDocument() {
#Write event code here
}
NewDocument_Post:
Register-InventorEvent -EventName NewDocument_Post -Action 'PostNewDocument'
function PostNewDocument() {
#Write event code here
}
The NewEditObject event notifies a client when the edit object is changing.
EventNames:
NewEditObject_Pre
NewEditObject_Post
Examples:
NewEditObject_Pre:
Register-InventorEvent -EventName NewEditObject_Pre -Action 'PreNewEditObject'
function PreNewEditObject() {
#Write event code here
}
NewEditObject_Post:
Register-InventorEvent -EventName NewEditObject_Post -Action 'PostNewEditObject'
function PostNewEditObject() {
#Write event code here
}
The NewView event notifies a client when a new View object is created.
EventNames:
NewView_Pre
NewView_Post
Examples:
NewView_Pre:
Register-InventorEvent -EventName NewView_Pre -Action 'PreNewView'
function PreNewView() {
#Write event code here
}
NewView_Post:
Register-InventorEvent -EventName NewView_Post -Action 'PostNewView'
function PostNewView() {
#Write event code here
}
The OpenDocument event notifies the client when a document is opened.
EventNames:
OpenDocument_Pre
OpenDocument_Post
Parameters
Type |
Name |
Description |
|---|---|---|
String |
fullDocumentName |
Output string that specifies the fully qualified name of the document being opened. This is supplied both before and after. |
Examples:
OpenDocument_Pre:
Register-InventorEvent -EventName OpenDocument_Pre -Action 'PreOpenDocument'
function PreOpenDocument() {
#Write event code here
}
OpenDocument_Post:
Register-InventorEvent -EventName OpenDocument_Post -Action 'PostOpenDocument'
function PostOpenDocument() {
#Write event code here
}
The ApplicationReady event notifies the client when Inventor has completely initialized and is ready for interactive use.
Remarks
Warning
This event is currently not supported, as powerEvents starts up after the Vault log in, when Inventor is already past its ready stage.
EventNames:
ApplicationReady_Post
Examples:
ApplicationReady_Post:
Register-InventorEvent -EventName ApplicationReady_Post -Action 'PostApplicationReady'
function PostApplicationReady() {
#Write event code here
}
The SaveDocument notifies the client whenever a document is saved.
Remarks
The notification is made when the standard Save and the Save Copy As commands are invoked. When assemblies are saved this can also cause the dependent documents to be saved and this event is also fired in those cases.
EventNames:
SaveDocument_Pre
SaveDocument_Post
Examples:
SaveDocument_Pre:
Register-InventorEvent -EventName SaveDocument_Pre -Action 'PreSaveDocument'
function PreSaveDocument() {
#Write event code here
}
SaveDocument_Post:
Register-InventorEvent -EventName SaveDocument_Post -Action 'PostSaveDocument'
function PostSaveDocument() {
#Write event code here
}
The TerminateDocument event notifies the client when a document is being terminated. Termination of a document is a complete close of a document.
EventNames:
TerminateDocument_Pre
TerminateDocument_Post
Parameters
Type |
Name |
Description |
|---|---|---|
String |
fullDocumentName |
Output string that specifies the fully qualified name of the document being terminated. This is supplied both before and after. |
Examples:
TerminateDocument_Pre:
Register-InventorEvent -EventName TerminateDocument_Pre -Action 'PreTerminateDocument'
function PreTerminateDocument($fullDocumentName) {
#Write event code here
}
TerminateDocument_Post:
Register-InventorEvent -EventName TerminateDocument_Post -Action 'PostTerminateDocument'
function PostTerminateDocument($fullDocumentName) {
#Write event code here
}
The TranslateDocument event notifies the client whenever a file is translated into inventor or an Inventor document is translated out to a non-Inventor file.
EventNames:
TranslateDocument_Pre
TranslateDocument_Post
Parameters
Type |
Name |
Description |
|---|---|---|
bool |
translatingIn |
Input Boolean that specifies whether the document is being translated into Autodesk Inventor. |
String |
fullFileName |
The full filename of the document being translated. This is supplied both before and after. |
Examples:
TranslateDocument_Pre:
Register-InventorEvent -EventName TranslateDocument_Pre -Action 'PreTranslateDocument'
function PreTranslateDocument($translatingIn, $fullFileName) {
#Write event code here
}
TranslateDocument_Post:
Register-InventorEvent -EventName TranslateDocument_Post -Action 'PostTranslateDocument'
function PostTranslateDocument($translatingIn, $fullFileName) {
#Write event code here
}