Working with assembly documents using SOLIDWORKS Document Manager API

Edit ArticleEdit Article

Unlike regular SOLIDWORKS API, Document Manager doesn't provide a specific interface for the assembly document rather it should be managed by ISwDMDocument and ISwDMConfiguration2 interfaces.

Some of the methods in those interfaces are exclusive to assembly document only, e.g ISwDMConfiguration2::GetComponents or ISwDMDocument8::GetComponentCount.

It is recommended to use ISwDMDocument::FullName SOLIDWORKS Document Manager API to get the full path and match its extension to .sldasm to validate that document is an assembly.

This section contains examples and macros related to working with assembly documents using Document Manager.


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