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.