Configuration Activation Macro

Hello

I apologize in advance for making a duplicate but I can't find the place on the site where I downloaded this macro: For the activation of configurations:


Sub main()

    Dim swApp                       As SldWorks.SldWorks
    Dim swModel                     As SldWorks.ModelDoc2
    Dim swConfigMgr                 As SldWorks.ConfigurationManager
    Dim swConfig                    As SldWorks.Configuration
    Dim vConfigName                 As Variant
    Dim sSpecConfigNameArr(0)       As String
    Dim vSpecConfigNameArr          As Variant
    Dim dimValue                    As Variant
    Dim stnameConfig As String
   
    Set swApp = Application.SldWorks
    'on récupére le document actif
    Set swModel = swApp.ActiveDoc
    
    Set swConfigMgr = swModel.ConfigurationManager
    'on récupére la configuration active
    Set swConfig = swConfigMgr.ActiveConfiguration
    'on récupére de nom de la configation active
    stnameConfig = swConfig.Name
    'on récupére le nom de toutes les configurations
    vConfigNameArr = swModel.GetConfigurationNames
    'on boucle
    For Each vConfigName In vConfigNameArr
        'on affiche la configuration
        swModel.ShowConfiguration2 vConfigName
         'on force la reconstruction
        swModel.ForceRebuild3 False
       
    Next vConfigName
        
    'on affiche la configuration active avant le traitement
    swModel.ShowConfiguration2 stnameConfig
    'on force la reconstruction
    swModel.ForceRebuild3 False
    'on sauvegarde le document
    swModel.Save3 swSaveAsOptions_e.swSaveAsOptions_Silent, 0, 0
    
End Sub

And there are lines of code that I don't quite understand: 

- In the code there is a variable used "vConfigNameArr" but I don't understand because it is not declared.
- I don't understand these two statements:     Dim sSpecConfigNameArr(0)       As String
                                                                                             Dim vSpecConfigNameArr          as Variant
In addition, these variables are not used.
- Finally, I don't understand: swModel.ForceRebuild3 False? Why FALSE please?

I specify that I am in macro construction so I could not test if it works from the base.

Thank you

Indeed, vConfigNameArr is not offset, but vSpecConfigNameArr. I think this is a mistake.

The two variables were effectively useless.

I think you should use the online help more which is a gold mine for any programming. Here's your answer for the ForceRebuild3 :

Parameters

"TopOnly

True rebuilds the top-level assembly only; false rebuilds the top-level assembly and all subassemblies"

The objective of macro? Check if a configuration named XX exists and if so activate it? 

Thank you for your answers remrem ! I have already noticed that the help was very very useful but this macro coming from someone on the forum I thought I might as well ask directly here.

 Originally, I don't know what the purpose was, but in my case I have configurations for 3D and for my drawings, but I noticed that in some cases, so that the drawing doesn't cause update problems, you just had to activate it and force the reconstruction.