Managing SOLIDWORKS documents via API

Edit ArticleEdit Article

SOLIDWORKS document represented as IModelDoc2 interface in SOLIDWORKS API.

SOLIDWORKS allows to open and keep active multiple documents at a time. Furthermore documents might have embedded documents, for example assemblies often have another assemblies or parts linked to them as components, drawings refer underlying documents for loading drawing views and also parts can have embedded parts.

Note that the documents can be invisible (for example loaded in assembly) but still loaded into the memory and can be traversed and accessed from API methods.

This section contains code examples and macros demonstrating the techniques of managing the documents (enumerating, closing, activating, opening, identifying the types) using SOLIDWORKS API.

Notifications

All articles and code at CodeStack are now open-source and hosted on GitHub. If you want to contribute by modifying existing articles and code snippets, submitting new ones, reporting errors and bugs etc. please follow this blog post for more information. We appreciate any contribution.


Product of Xarial Product of Xarial