Hide Table of Contents
Getting Started

This topic provides information to help you get started with using the SolidWorks Document Manager API. 

License Key

The SolidWorks Document Manager API requires a license key that is only available via the SolidWorks customer portal to SolidWorks customers who are currently under subscription.

To request a SolidWorks Document Manager API license key:

  1. Log into the SolidWorks customer portal.
  2. Click API Support in My Support
  3. Click Document Manager key request in step 4.
  4. Follow the online instructions to request your license key.

A SolidWorks Document Manager API license key is emailed to you upon approval of your request. 

IMPORTANT: Do not share this license key with anyone outside your company or distribute it with any software that you ship.

You must specify the license key when instantiating a SolidWorks Document Manager API connection. See Application Basics for details.

 

Back to top

Software Requirements

 

The SolidWorks Document Manager API requires MSXML 4.0 (Microsoft XML Core Services) or later; MSXML 6.0 is the first version of MSXML that supports 64-bit processors.

NOTE: SolidWorks installs MSXML 4.0 by default, and MSXML is only needed if you want to use ISwDMComponent or ISwDMComponent2. If you need a later version of MSXML, download it from www.microsoft.com.

 

Back to top

Installation

 

Read the Software Requirements section before proceeding. MSXML must be installed in order to successfully register the SolidWorks Document Manager DLLs.

The SolidWorks Document Manager API is a COM object contained in SwDocumentMgr.dll. The SolidWorks Document Manager DimXpert API is contained in dimxpert.dll. The zlib.dll DLL was automatically installed in the following folder if you installed the SolidWorks software:

<disk>:\Program Files\Common Files\SolidWorks Shared

SwDocumentMgr.dll and dimxpert.dll were also automatically registered if you installed the SolidWorks software.

If you did not install the SolidWorks software on the system where you want to use these APIs, you can manually register them.

SwDocumentMgr.dll and zlib.dll must either reside in the same folder or be accessible via the Windows search path.

To manually register SwDocumentMgr.dll:

  1. Click Start, Run.

  2. In the dialog box, type:

    regsvr32  "
    <disk>:\Program Files\Common Files\SolidWorks Shared\SwDocumentMgr.dll"

  3. Click OK.

  4. Click OK again.

NOTE: Install programs, such as InstallShield, can automatically register the DLL for you.

 

To manually unregister SwDocumentMgr.dll:

  1. Click Start, Run.

  2. In the dialog box, type:

    regsvr32  /u "
    <disk>:\Program Files\Common Files\SolidWorks Shared\SwDocumentMgr.dll"

  3. Click OK.

  4. Click OK again.

You can redistribute swDocumentMgr.dll and zlib.dll.

 

To manually register dimxpert.dll:

  1. Click Start, Run.

  2. In the dialog box, type (vX.X is the name of a version directory that contains RegAsm.exe):

    C:\WINDOWS\Microsoft.NET\Framework\
    vX.X\regasm /codebase  "<disk>:\Program Files\Common Files\SolidWorks Shared\dimxpert.dll

  3. Click OK.

Back to top

Application Basics 

 

Writing a SolidWorks Document Manager application typically involves:

  1. Instantiating a SolidWorks Document Manager connection (ISwDMClassFactory::GetApplication).

    NOTE: You must have a license key from SolidWorks Corporation to instantiate the application object.

  2. Opening a file (ISwDMApplication::GetDocument).

  3. Querying the file for data such as custom properties, configurations, references, and where the file is used (ISwDMConfiguration::GetBodiesCount, ISwDMConfiguration::GetCustomPropertyNames, ISwDMDocument::GetAllExternalReferences, ISwDMDocument::GetHyperLinkAt).

  4. Extracting data such as Parasolid bodies, embedded eDrawings data, and XML data from assembles (ISwDMConfiguration::GetBody, ISwDMDocument::GetEDrawingsData, ISwDMDocument::GetXMLStream).

  5. Extracting features and annotations from DimXpert parts (ISwDMConfiguration12:DimXpertPart).

  6. Making changes (ISwDMDocument::AddCustomProperty, ISwDMDocument::DeleteCustomProperty, ISwDMDocument::ModifyHyperLinkAt, ISwDMDocument::ReplaceReference, ISwDMDocument::SetCustomProperty).

  7. If any changes are made, saving the document (ISwDMDocument::Save or ISwDMDocument::SaveAs).

  8. Closing the document (ISwDMDocument::CloseDoc).

    NOTE:
    You must close a document before you can copy or move it using ISwDMApplication::CopyDocument or ISwDMApplication::MoveDocument.

Be sure to examine all returned error codes.

NOTE: Documents created using SolidWorks 99 (Version 1137) or earlier are not supported by this API. See ISwDMDocument::GetVersion for a detailed list of SolidWorks versions supported by this API.

Back to top



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Getting Started - SolidWorks.Interop.swdocumentmgr
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:




x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2012 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.