9 Replies Latest reply on Dec 13, 2013 7:59 AM by Deepak Gupta

    GetConfigurationNames not working in SW2014 ?

    Checkcheck Master

      Anyone ?

       

      I use this command to retrieve the configuration names from a file.

      In SW2012/2013 there's no problem using it.

      Now in SW2014 it's not working anymore.

      Tried the example within the API help, same result, working in SW2012/2013, not working in SW2014.

      Is there something changed in SW2014 regarding this command ?

       

       

      Greetings !

       

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

      Option Explicit

      Sub main()

           Dim swApp                   As SldWorks.SldWorks

           Dim swModel                 As SldWorks.ModelDoc2

           Dim vConfigName             As Variant

           Dim sConfigName             As String

           Dim swConfig                As SldWorks.Configuration

           Dim i                       As Long

           Dim bRet                    As Boolean

       

          Set swApp = CreateObject("SldWorks.Application")

           Set swModel = swApp.ActiveDoc

            Set swConfig = swModel.GetActiveConfiguration

       

          Debug.Print "File = " & swModel.GetPathName

          Debug.Print "  Active Config = " & swConfig.Name

          Debug.Print ""

       

          vConfigName = swModel.GetConfigurationNames

       

          For i = 0 To UBound(vConfigName)

          sConfigName = vConfigName(i)

       

              Set swConfig = swModel.GetConfigurationByName(sConfigName)

       

               Debug.Print "  ConfigName(" + Str(i) + ") = " + sConfigName

               Debug.Print "    UseAlternateNameInBOM = " + Str(swConfig.UseAlternateNameInBOM)

               Debug.Print "    AlternateName         = " + swConfig.AlternateName

               Debug.Print "    Comment               = " + swConfig.Comment

               Debug.Print ""

       

          Next i

       

      End Sub

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