US$0.00
0

Author: Amen Jlili

A Practical Guide to the SOLIDWORKS PDM API in 2026

The SOLIDWORKS PDM API is one of the most capable developer tools in the SOLIDWORKS ecosystem. It is built as a Windows COM object library. This architecture provides very deep access to the vault, workflows, variables, and the entire PDM client environment. Many developers expect a modern HTTP interface similar to typical cloud APIs. The PDM API works differently. It is stateful, local, and tightly integrated with the Windows process that runs the PDM client. A good place to start with the SOLIDWORKS PDM API is the official documentation. Most API calls have examples in C#, VB.NET and VBA. A COM Object Model, Not a REST API Since the PDM API is COM-based, your application (If it is a .NET application) interacts with DLLs that are registered in Windows: From the context of VBA macros, the references are slightly different. When you install the PDM client, a reference called PDMWorks Enterprise XXXX Type Library is installed for you: There are no HTTP requests, no token-based authentication, no JSON data formats, and no web callbacks. You communicate directly with PDM using COM interfaces such as: IEdmVault5IEdmFile5IEdmFolder5 This gives developers immediate, high-performance access to metadata, folders, variables, references, and workflow information. Because the calls happen inside the PDM client session, they can respond instantly to events such as check-in, state change, add file, add folder, or card interactions. Which Programming Languages Work With the SOLIDWORKS PDM API Any language that supports COM interop can be used. The most common today are: Python can also be used, but only through external COM wrappers. Simple VBA Macro to Log Into a Vault Below is a simple VBA example that connects to a PDM Professional vault. This can be used inside a SOLIDWORKS macro or Excel macro. This is the most basic example but it shows how COM objects are created and used. PDM Convert Task PDM ships with the SOLIDWORKS Task Add-in. This add-in can be used to create tasks (Scripts that run on the user’s machine or delegated to other computers on the network). These tasks have scripting pages where administrators can add/edit the VBA logic of the task. These types of scripts are commonly used in PDM tasks that generate PDF, DXF, or STEP documents. Developing With C# in .NET Most modern PDM development is done in C#. To use the PDM API, reference the assemblies mentioned above. A simple C# example to log into a vault looks like this: From there, developers typically work with interfaces like: IEdmFolder5IEdmFile5IEdmBatchGetIEdmBatchUpdateIEdmEnumeratorVariable5 These provide almost complete access to files, references, variables, and metadata. Types of Applications You Can Build Developers use the PDM API to create many types of solutions. The most common categories are shown below. PDM Add InsRuns directly inside the PDM client. Best for deep automations like revision control logic, approval logic, or multi-file processing. A great example of this is our free column set customizer.PDM TasksAutomate file conversion, data extraction, printing, publishing, or scripted actions. Tasks run inside a controlled environment and support COM, .NET, and native add-ins. PDMPublisher, a Blue Byte Systems Inc product, is another example.Desktop UtilitiesStandalone EXE tools that use IEdmVault5 to log in and perform batch actions such as metadata cleanup or migration. Check out PDMShell: our data management solution inside of SOLIDWORKS PDM. Learn the PDM API in Three Days With Blue Byte Systems If you want to master the PDM API quickly, Blue Byte Systems offers a hands-on three-day training course that covers the full API stack. You learn how to build real add-ins, tasks, macros, workflow hooks, batch tools, and event-driven automations. The course walks you through live examples and real vault scenarios so you can apply everything immediately in your environment. If you or your team would like details, you can reach out directly at amen@bluebyte.biz

Read More »

SOLIDWORKS Macro to Set Layer and Draw Line in SolidWorks Drawing

Description This macro sets the specified layer as the current layer in the active SolidWorks drawing document and adds a sketched line on that layer. It automates the process of layer management and drawing creation, ensuring that all subsequent sketched entities are added to the specified layer. This is particularly useful for organizing different sketch entities in separate layers. A SolidWorks macro to set layer and draw line in SolidWorks drawing helps users to keep drawing elements structured without any repetitive manual steps. System Requirements Pre-Conditions Results VBA Macro Code Macro You can download the macro from here. Customization Need to modify the macro to meet specific requirements or integrate it with other processes? We provide custom macro development tailored to your needs. Contact us.

Read More »

SOLIDWORKS Macro to Align All Dimensions Automatically

Description This VBA macro automates selecting and arranging dimensions in SOLIDWORKS drawings. It loops through views, selects display dimensions, and auto-arranges them. System Requirements To run this VBA macro, ensure that your system meets the following requirements: Prerequisites In order for the macro to run as intended, the following condition must be satisfied: Steps to Set Up the Macro Open Your Drawing Load the Macro File (.swp) This SolidWorks macro to align all dimensions automatically ensures your dimension layout stays clean and readable without manual adjustments. Run the Macro VBA Macro Code Macro You can download the macro from here. Customization Need to modify the macro to meet specific requirements or integrate it with other processes? We provide custom macro development tailored to your needs. Contact us.

Read More »

SOLIDWORKS Macro to Programmatically Insert a Block into SolidWorks Drawing

Description A one-line function call to programmatically insert a block into SolidWorks drawing allows you to quickly place a block in the active document. This macro returns the SketchBlockInstance for the inserted block, enabling users to efficiently place and manage sketch blocks within a drawing. It is particularly useful for automating the placement of standardized blocks, reducing repetitive tasks. System Requirements Pre-Conditions Results VBA Macro Code Macro You can download the macro from here. Customization Need to modify the macro to meet specific requirements or integrate it with other processes? We provide custom macro development tailored to your needs. Contact us

Read More »

SOLIDWORKS Macro to Rebuild and Save All Drawings in a Directory as PDF

Description This macro rebuilds all SolidWorks drawing files (.SLDDRW) in a specified directory and saves them as PDF files in the same location. It automates the process of batch exporting drawings to PDFs, making it ideal for users who need to handle large quantities of files efficiently. By using a SOLIDWORKS macro to rebuild and save all drawings in a directory as PDF, teams can ensure every updated drawing is exported consistently without manual effort. System Requirements Pre-Conditions Post-Conditions VBA Macro Code ‘ Disclaimer:’ The code provided should be used at your own risk. ‘ Blue Byte Systems Inc. assumes no responsibility for any issues or damages that may arise from using or modifying this code. ‘ For more information, visit [Blue Byte Systems Inc.](https://bluebyte.biz).Option Explicit’ Define the main variables for SolidWorks application and modelDim swApp As SldWorks.SldWorksDim swModel As ModelDoc2Dim swFilename As StringDim swRet As BooleanDim swErrors As LongDim swWarnings As LongDim swResponse As String’ Main subroutineSub Main() ‘ Initialize SolidWorks application Set swApp = Application.SldWorks ‘ Specify the folder location containing the SolidWorks drawings RebuildAndSaveAllDrawingsAsPDF “C:\SOLIDWORKS”, “.SLDDRW”, TrueEnd Sub’ Subroutine to rebuild drawing and save as PDFSub RebuildAndSaveAllDrawingsAsPDF(swFolder As String, swExt As String, swSilent As Boolean) Dim swDocTypeLong As Long ‘ Ensure the file extension is in uppercase swExt = UCase$(swExt) swDocTypeLong = Switch(swExt = “.SLDDRW”, swDocDRAWING, True, -1) ‘ If the file type is not supported, exit the subroutine If swDocTypeLong = -1 Then Exit Sub End If ‘ Change directory to the folder ChDir (swFolder) ‘ Get the first file in the folder swResponse = Dir(swFolder) Do Until swResponse = “” swFilename = swFolder & swResponse ‘ Check if the file extension matches If Right(UCase$(swResponse), 7) = swExt Then ‘ Open the SolidWorks document Set swModel = swApp.OpenDoc6(swFilename, swDocTypeLong, swOpenDocOptions_Silent, “”, swErrors, swWarnings) ‘ Rebuild the drawing if it’s a drawing file If swDocTypeLong <> swDocDRAWING Then swModel.ShowNamedView2 “*Isometric”, -1 End If ‘ Define file path variables Dim swFilePath As String Dim swPathSize As Long Dim swPathNoExtension As String Dim swNewFilePath As String swFilePath = swModel.GetPathName swPathSize = Strings.Len(swFilePath) swPathNoExtension = Strings.Left(swFilePath, swPathSize – 6) swNewFilePath = swPathNoExtension & “PDF” ‘ Save the document as PDF swRet = swModel.SaveAs3(swNewFilePath, 0, 0) ‘ Close the document swApp.CloseDoc swModel.GetTitle End If ‘ Get the next file in the folder swResponse = Dir LoopEnd Sub Macro You can download the macro from here. Customization Need to modify the macro to meet specific requirements or integrate it with other processes? We provide custom macro development tailored to your needs. Contact us.

Read More »

SolidWorks Macro to Batch Rebuild and Export Drawings to PDF

Description The script will automatically rebuild all SolidWorks drawing files (.SLDDRW) in a user-specified Windows directory, assuring every view and annotation is up to date, and will immediately save each as a PDF file. System Requirements Pre-requisites Results Steps to Set Up the Macro RebuildAndSaveAllDrawingsAsPDF “C:\SOLIDWORKS”, “.SLDDRW”, True Replace “C:\SOLIDWORKS” with the target folder where your drawing files are located. This SOLIDWORKS macro to batch rebuild and export drawings to PDF helps streamline this process by automating rebuild and export tasks for all drawings within the specified folder. VBA Macro Code Macro You can download the macro from here. Need Customization & Expert Support? If so, make sure to reach out! Our specialized team at Blue Byte Systems Inc. develops custom macros and add-ins to meet these advanced workflow needs.

Read More »
0
    0
    Your Cart
    Your cart is emptyReturn to Shop
    ×
    0
      0
      Your Cart
      Your cart is emptyReturn to Shop
      ×