SketchChange
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 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
}