Assembly Events

The AssemblyDelete event notifies the client whenever an object within this events set is deleted in a document.

Remarks

Assembly objects currently reported are ComponentOccurrence and AssemblyConstraint objects. The Document.OnDelete event can be used if delete notification is needed for other types of objects.

EventNames:

  • AssemblyDelete_Pre

  • AssemblyDelete_Post

Examples:

AssemblyDelete_Pre:

Register-InventorEvent -EventName AssemblyDelete_Pre -Action 'PreAssemblyDelete'

function PreAssemblyDelete() {
	#Write event code here
}

AssemblyDelete_Post:

Register-InventorEvent -EventName AssemblyDelete_Post -Action 'PostAssemblyDelete'

function PostAssemblyDelete() {
	#Write event code here
}

The LoadStateChange event notifies the client whenever an assembly document goes from lite to full or full to lite loading.

EventNames:

  • LoadStateChange_Pre

  • LoadStateChange_Post

Parameters

Type

Name

Description

DocumentLoadStateEnum

newLoadState

Input DocumentLoadStateEnum value indicating the state the document is changing to when the timing kBefore and the current state when the timing is kAfter.

Examples:

LoadStateChange_Pre:

Register-InventorEvent -EventName LoadStateChange_Pre -Action 'PreLoadStateChange'

function PreLoadStateChange($newLoadState) {
	#Write event code here
}

LoadStateChange_Post:

Register-InventorEvent -EventName LoadStateChange_Post -Action 'PostLoadStateChange'

function PostLoadStateChange($newLoadState) {
	#Write event code here
}

The NewOccurrence event is fired whenever a new occurrence is created.

EventNames:

  • NewOccurrence_Pre

  • NewOccurrence_Post

Examples:

NewOccurrence_Pre:

Register-InventorEvent -EventName NewOccurrence_Pre -Action 'PreNewOccurrence'

function PreNewOccurrence() {
	#Write event code here
}

NewOccurrence_Post:

Register-InventorEvent -EventName NewOccurrence_Post -Action 'PostNewOccurrence'

function PostNewOccurrence() {
	#Write event code here
}

The NewRelationship event notifies the client when a new constraint or connection is added to an assembly.

EventNames:

  • NewRelationship_Pre

  • NewRelationship_Post

Examples:

NewRelationship_Pre:

Register-InventorEvent -EventName NewRelationship_Pre -Action 'PreNewRelationship'

function PreNewRelationship() {
	#Write event code here
}

NewRelationship_Post:

Register-InventorEvent -EventName NewRelationship_Post -Action 'PostNewRelationship'

function PostNewRelationship() {
	#Write event code here
}

Event that is fired whenever an occurrence changes.

EventNames:

  • OccurrenceChange_Pre

  • OccurrenceChange_Post

Examples:

OccurrenceChange_Pre:

Register-InventorEvent -EventName OccurrenceChange_Pre -Action 'PreOccurrenceChange'

function PreOccurrenceChange() {
	#Write event code here
}

OccurrenceChange_Post:

Register-InventorEvent -EventName OccurrenceChange_Post -Action 'PostOccurrenceChange'

function PostOccurrenceChange() {
	#Write event code here
}