Automating SOLIDWORKS parts, assemblies and drawings using API

Edit ArticleEdit Article

Automating of SOLIDWORKS documents with API
Automating of SOLIDWORKS documents with API

SOLIDWORKS documents (parts, assemblies and drawings) provide large amount of API functions for automation.

There are common functionalities which are available for all types of documents and usually accessible via IModelDoc2 or IModelDocExtension SOLIDWORKS API interfaces.

This includes but not limited to:

  • Annotations
  • Sketch
  • Feature Manager

There are also specific functionalities available only for the specific types of documents

  • Parts APIs are available via IPartDoc interface
  • Assemblies APIs are available via IAssemblyDoc interface
  • Drawings APIs are available via IDrawingDoc interface

Specific interface can be cast to the generic interface and vice verse.

IModelDocExtension can be accessed via IModelDoc2::Extension property.

Product of Xarial Product of Xarial