Sketch Events

The NewSketch event notifies the client whenever a sketch is created. _Pre fires before and _Post after the sketch is created.

EventNames:

  • NewSketch_Pre

  • NewSketch_Post

Parameters

Type

Name

Description

Document

document

Document object that indicates the document in which the change occurred.

Examples:

NewSketch_Pre:

Register-InventorEvent -EventName NewSketch_Pre -Action 'PreNewSketch'

function PreNewSketch($document) {
	#Write event code here
}

NewSketch_Post:

Register-InventorEvent -EventName NewSketch_Post -Action 'PostNewSketch'

function PostNewSketch($document) {
	#Write event code here
}

The NewSketch3D event notifies the client when a new 3D sketch is created. _Pre fires before and _Post after the sketch is created.

EventNames:

  • NewSketch3D_Pre

  • NewSketch3D_Post

Parameters

Type

Name

Description

Document

document

Document object the new 3D sketch is being created within.

Examples:

NewSketch3D_Pre:

Register-InventorEvent -EventName NewSketch3D_Pre -Action 'PreNewSketch3D'

function PreNewSketch3D($document) {
	#Write event code here
}

NewSketch3D_Post:

Register-InventorEvent -EventName NewSketch3D_Post -Action 'PostNewSketch3D'

function PostNewSketch3D($document) {
	#Write event code here
}

The Sketch3DChange event notifies the client when the geometry of a 3D sketch changes: when geometry is added, modified (directly or by editing the value of a dimension constraint) or deleted, or when a constraint is placed or deleted in a way that changes geometry. _Pre fires before and _Post after the sketch is changed.
Placing a constraint only triggers the event if the geometry has to change (for example two lines that are not yet perpendicular). Adding a dimension constraint or deleting a constraint does not change the geometry and does not trigger the event, but editing the value of a dimension does.

EventNames:

  • Sketch3DChange_Pre

  • Sketch3DChange_Post

Parameters

Type

Name

Description

Document

document

Document object the 3D sketch is within.

Remarks:

Sketch changes that fire this event include adding new geometry, modifying existing geometry either directly or indirectly by editing dimension constraints, deleting geometry, and placing or deleting constraints where it will cause a change in any geometry.

Examples:

Sketch3DChange_Pre:

Register-InventorEvent -EventName Sketch3DChange_Pre -Action 'PreSketch3DChange'

function PreSketch3DChange($document) {
	#Write event code here
}

Sketch3DChange_Post:

Register-InventorEvent -EventName Sketch3DChange_Post -Action 'PostSketch3DChange'

function PostSketch3DChange($document) {
	#Write event code here
}

The SketchChange event notifies the client when the geometry of a 2D sketch changes: when geometry is added, modified (directly or by editing the value of a dimension constraint) or deleted, or when a constraint is placed or deleted in a way that changes geometry. _Pre fires before and _Post after the sketch is changed.
Placing a constraint only triggers the event if the geometry has to change (for example two lines that are not yet perpendicular). Adding a dimension constraint or deleting a constraint does not change the geometry and does not trigger the event, but editing the value of a dimension does.

EventNames:

  • SketchChange_Pre

  • SketchChange_Post

Parameters

Type

Name

Description

Document

document

Document object the 2D sketch is within.

Remarks:

Sketch changes that fire this event include adding new geometry, modifying existing geometry either directly or indirectly by editing dimension constraints, deleting geometry, and placing or deleting constraints where it will cause a change in any geometry.

Examples:

SketchChange_Pre:

Register-InventorEvent -EventName SketchChange_Pre -Action 'PreSketchChange'

function PreSketchChange($document) {
	#Write event code here
}

SketchChange_Post:

Register-InventorEvent -EventName SketchChange_Post -Action 'PostSketchChange'

function PostSketchChange($document) {
	#Write event code here
}

The SketchDelete event notifies the client when a 2D or 3D sketch is deleted. The event is only fired when the sketch itself is deleted, not when its contents are deleted. _Pre fires before and _Post after the sketch is deleted.

EventNames:

  • SketchDelete_Pre

  • SketchDelete_Post

Parameters

Type

Name

Description

Document

document

Document object that contains the sketch.

Examples:

SketchDelete_Pre:

Register-InventorEvent -EventName SketchDelete_Pre -Action 'PreSketchDelete'

function PreSketchDelete($document) {
	#Write event code here
}

SketchDelete_Post:

Register-InventorEvent -EventName SketchDelete_Post -Action 'PostSketchDelete'

function PostSketchDelete($document) {
	#Write event code here
}