Site icon BLUE BYTE SYSTEMS INC.

SOLIDWORKS PDM API TIP: Cancel certain events in PDM

SOLIDWORKS PDM API TIP_ Cancel certain events in PDM and

An illustration of a person working at a computer, with hands on a keyboard and mouse. The computer screen displays a 3D model of a mechanical part with a hole, viewed in a design software interface showing tools like "Pains," "Origine," "Extrusion," and "Add Step" on the left sidebar. An orange gear icon with a small robot face overlays the screen, symbolizing automation or AI assistance in the design process.

By registering to the correct hooks in the GetAddInInfo method and by using poCmd.Cancel = 1 in the OnCmd method, your add-in can cancel certain events in PDM to prevent users from performing operations like deleting a critical file, checking in a document with incomplete metadata, or renaming an inappropriate part. This is the primary tenet for best practice data management and enforcement.

PDM Event Hooks: Your Control Panel

You can also cancel tasks during the EdmCmd_TaskLaunch hook.

The following table provides an overview of the cancellable events that are available in your local SOLIDWORKS PDM vault. The use of these hooks is crucial to develop an add-in that will validieren mit PDM (validate with PDM) and maintain data integrity.
Command TypeDescription
EdmCmd_PreExploreInitExecuted before a new instance of File Explorer is created. Used to personalize vault view tabs before display.
EdmCmd_PreAddRaised when a file is on the verge of being included in the vault. Utilized to provide naming conventions or verify file types.
EdmCmd_PreAddFolderRaised when a new folder is on the verge of being added. Utilized for pre-creation verification or logic.
EdmCmd_PreCopyRaised before copying a file. Provides an opportunity for custom processing or verification.
EdmCmd_PreCopyFolderRaised prior to copying a folder. Utilized for pre-copy logic.
EdmCmd_PreDeleteRaised before deleting a file. A critical precaution against mistaken or unauthorized deletions.
EdmCmd_PreDeleteFolderTriggers before a folder is deleted. Allows pre-deletion checking.
EdmCmd_PreGetTriggers before getting a file from the vault (e.g., Get Latest/Get Version). Offers control over get.
EdmCmd_PreLabelTriggers before creating a label. Useful in checking the creation of our content in the label.
EdmCmd_PreLabelDeleteTriggers before deleting a label. Allows checks before deletion.
EdmCmd_PreLabelModifyTriggers before changing a label. Allows checking or pre-modification processing.
EdmCmd_PreLabelAddItemOccurs before putting an item in a label. Suits validation or custom processing.
EdmCmd_PreLockOccurs before check-out of a file. Suitable for pre-check-out validation.
EdmCmd_PreMoveOccurs before moving a file. Supports pre-move validation or processing.
EdmCmd_PreMoveFolderOccurs before moving a folder. Supports folder move validation.
EdmCmd_PreRenameOccurs before renaming a file. Suitable for pre-rename checks or custom processing.
EdmCmd_PreRenameFolderOccurs before renaming a folder. Suits pre-rename validation.
EdmCmd_PreShareOccurs before a file is shared between two folders. Implements pre-share logic.
EdmCmd_PreStateTriggered before setting the state of a file in a workflow. A strong hook for implementing challenging business rules.
EdmCmd_PreUndoLockTriggered before undoing a check-out (equivalent to check-in of an unmodified file).
EdmCmd_PreUnlockTriggered before the check-in of an updated file. Employs significant pre-check-in validation.

A Practical Approach to API-Based PDM Customization

Here’s how you would do this using the SOLIDWORKS PDM API Tip:

As an example, you could use the EdmCmd_PreState hook to cancel certain events in PDM and prevent a file from moving into a “Released” state if all required data card variables are not filled out. This method of validation with PDM Blue guarantees that all files in your environment are complete and correct, protecting your data integrity right from the beginning.

Our Experts Are Here to Help You

For expert add-in development and professional SOLIDWORKS support, visit Blue Byte System Inc. We specialize in offering services to improve productivity and streamline your workflows.

Exit mobile version