AnsweredAssumed Answered

What changed in 2018 document manager?

Question asked by Velid Sales on May 7, 2018
Latest reply on Aug 30, 2018 by Y. Js

I have function that we used since SW 2015 that checked one of field we designated for revision and compared it with revision level in our ERP software. Since we upgraded to SW 2018, function does not work anymore. First I got license key errors, and  now that I resolved that, it still does not work. Here is mu function:


Function getSWRevLev(strFile As String) As String


    'some variables


    Dim strMsg As String

    Dim strRev As String

    Dim myDMCF As SwDocumentMgr.SwDMClassFactory

    Dim myDocMgr As SwDocumentMgr.SwDMApplication

    Dim mySWDoc As SwDocumentMgr.SwDMDocument


    'create sw connection

    On Error Resume Next

    Set myDMCF = New SwDocumentMgr.SwDMClassFactory

    Set myDocMgr = myDMCF.GetApplication(SWDMLIC)


    'check if there was connection

    If myDocMgr Is Nothing Then


        strMsg = "Unable to connect to SolidWorks Document Manager!"

        MsgBox strMsg, vbCritical + vbOKOnly, "Error"

        getSWRevLev = "N/A"

        Exit Function


    End If


    Set mySWDoc = myDocMgr.GetDocument(strFile, swDmDocumentUnknown, True, Empty)


    strRev = mySWDoc.GetCustomProperty("Revision", swDmCustomInfoText)


    getSWRevLev = strRev


    Set mySWDoc = Nothing

    Set myDMCF = Nothing

    Set myDocMgr = Nothing


End Function


A idea what has changed to make this function not work.

It seems that even first line (Set myDMCF = New SwDocumentMgr.SwDMClassFactory) returns 'nothing'.