Document manager API and Old files

I have problems using the document manager api with older solidworks files.

I have a macro that opens the file, loops over all configurations and uses GetComponents from SwDMConfiguration13. Please see code snippet below.

It fails on older files, e.g. returning an "Empty" list of components.

What is the best solution for this?

Best regards

   Jeppe

---------------------------------------------------------------------------------------

                        Set swConf = swConfMgr.GetConfigurationByName(ConfName)

                        swCompArray = swConf.GetComponents

                        If Not IsEmpty(swCompArray) Then

                            For i = 0 To UBound(swCompArray)

                                Set swComp = swCompArray(i)

SolidworksApi macros
Answers 1
KR
KR 2015-06-15 Best Answer

The API Help remarks for ISwDMConfiguration2::GetComponents

<p>This method only returns data for documents created using SOLIDWORKS 2003 (Version 2200) and later. To get the version of a document, use ISwDMDocument::GetVersion.</p>

It doesn't mention a workaround, unfortunately.

Keith

SolidWorks API Training & Services