Hide Table of Contents
Getting Started

Glossary Item Box

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. Each user of SOLIDWORKS Document Manager API must have a license key.

Existing users must request new SOLIDWORKS Document Manager API license keys beginning with SOLIDWORKS Document Manager API 2015 FCS and renew their SOLIDWORKS Document Manager API license keys when installing any new major release of SOLIDWORKS or the SOLIDWORKS Document Manager API.

SOLIDWORKS Document Manager API checks the version of the file being accessed. If the file was created using the same or an earlier version of SOLIDWORKS than the version of SOLIDWORKS Document Manager API license key, then SOLIDWORKS Document Manager API can access the file. However, if the file was created using a later version of SOLIDWORKS than the version of the SOLIDWORKS Document Manager API license key, then SOLIDWORKS Document Manager API cannot access the file and a message is displayed informing the user that the current SOLIDWORKS Document Manager API license key is expired. For example:

Version in which SOLIDWORKS file created Version of SOLIDWORKS Document Manager API license key File Access Result
2014 or earlier 2014 or earlier Success
2015 or later 2014 or earlier Failure
2015 or earlier 2015 or later Success

When requesting or renewing a SOLIDWORKS Document Manager API license key, you are presented with a dialog containing a list of check boxes showing the categories of functionality that a SOLIDWORKS Document Manager API license key controls. You can select more than one category.

  • Basic: All interfaces, methods, and properties except for those listed below
  • Previews: Preview and stream methods and properties on all ISwDMConfiguration, ISwDMDocument, and ISwDMSheet interfaces
  • DimXpert: DimXpert methods and properties on all ISwDMConfiguration and all DimXpert-related interfaces
  • Geometry Streams: Preview, stream, and imported body methods and properties on all ISwDMConfiguration interfaces
  • XML Streams: XML stream methods on all ISwDMDocument interfaces
  • Tesselation: Display List DLL (previously called the Display List Sample); although not a component of the SOLIDWORKS Document Manager API, its license key controls access to the Display List DLL

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.
  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:

  • Visual C++ Redistributable for Visual Studio 2015, which installs the runtime components of Visual C++ libraries. These runtime components are required to successfully register the SOLIDWORKS Document Manager 2018 DLL, which was developed using Visual Studio 2015.
  • Microsoft Core XML Services (MSXML) 4.0 or later; MSXML 6.0 is the first version of MSXML that supports 64-bit processors. MSXML is only needed if you want to use ISwDMComponent or ISwDMComponent2. Download MSXML from www.microsoft.com.

NOTE: A full SOLIDWORKS 2018 installation includes MSXML and the Visual C++ Redistributable for Visual Studio 2015. Clients installing SOLIDWORKS Document Manager on systems without a full SOLIDWORKS installation must also install MSXML and the Visual C++ Redistributable or ensure that they have been previously installed.

 

Back to top

Installation

 

Read the Software Requirements section before proceeding. MSXML and the Visual C++ Redistributable for Visual Studio 2015 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 and XML data from assemblies (ISwDMConfiguration::GetBody and 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, etc.).

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

    NOTE: If recreating an application using an example and the example uses a SOLIDWORKS sample file, do not save changes.

  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

 

Third-party Data in SOLIDWORKS Files

Starting with SOLIDWORKS 2015, third-party data stored in SOLIDWORKS files cannot be externally read or written by standard structured storage or compound file techniques.

To read or write third-party data, use the methods and events in the SOLIDWORKS API or SOLIDWORKS Document Manager API.

SOLIDWORKS API:

SOLIDWORKS Document Manager 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
*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) 2018 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.