In SOLIDWORKS PDM, normal add-ins can cancel specific event poCmd.Cancel = 1 in OnCmd method provided you subscribe to the right hooks in the GetAddInInfo method.
You can also cancel tasks during the EdmCmd_TaskLaunch hook. Here’s a concise list of events the in SOLIDWORKS PDM API you can cancel. You can only actions/events that occur in your local SOLIDWORKS vault. |
Command Type | Description |
EdmCmd_PreExploreInit | Triggered before a new instance of File Explorer is created. Allows customization of vault view tabs. |
EdmCmd_PreAdd | Triggered before adding a file to the vault. Useful for validating files or preparing for the addition. |
EdmCmd_PreAddFolder | Triggered before adding a folder to the vault. Provides an opportunity to handle pre-creation logic. |
EdmCmd_PreCopy | Triggered before copying a file. Allows custom processing or validation before the copy operation. |
EdmCmd_PreCopyFolder | Triggered before copying a folder. Enables pre-copy logic or checks for folders. |
EdmCmd_PreDelete | Triggered before deleting a file. Useful for validation or logging. |
EdmCmd_PreDeleteFolder | Triggered before deleting a folder. Allows pre-deletion checks or actions. |
EdmCmd_PreGet | Triggered before retrieving a file from the vault. Offers customization of the retrieval process. |
EdmCmd_PreLabel | Triggered before creating a label. Useful for validating label creation or customization. |
EdmCmd_PreLabelDelete | Triggered before deleting a label. Enables checks or additional logic before deletion. |
EdmCmd_PreLabelModify | Triggered before modifying a label. Allows for validation or pre-modification processing. |
EdmCmd_PreLabelAddItem | Triggered before adding an item to a label. Useful for validation or custom logic. |
EdmCmd_PreLock | Triggered before checking out a file. Enables pre-check-out validation or preparation. |
EdmCmd_PreMove | Triggered before moving a file. Allows pre-move validation or actions. |
EdmCmd_PreMoveFolder | Triggered before moving a folder. Enables validation or preparation for folder movement. |
EdmCmd_PreRename | Triggered before renaming a file. Allows checks or custom logic before renaming. |
EdmCmd_PreRenameFolder | Triggered before renaming a folder. Useful for pre-rename validation. |
EdmCmd_PreShare | Triggered before sharing a file from one folder to another. Allows for pre-share logic. |
EdmCmd_PreState | Triggered before changing the state of a file in a workflow. Useful for enforcing rules or validation. |
EdmCmd_PreUndoLock | Triggered before undoing a check-out (equivalent to check-in of an unmodified file). |
EdmCmd_PreUnlock | Triggered before checking in a modified file. Enables pre-check-in processing. |