How to activate use Configuration name?

Hope activate use named configuration with  API.

SolidworksApi macros
Answers 2
YN
YN 2014-04-02

Thank you reply, often using the GetReferencedModelName statement. But not with the ReferencedConfiguration statement.

*****************************************************************

Sub Main1()

    Dim swApp                       As SldWorks.SldWorks

    Dim swModel                     As SldWorks.ModelDoc2

    Dim swDraw                      As SldWorks.DrawingDoc

    Dim swView                      As SldWorks.View

    Dim bRet                        As Boolean

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

    Set swDraw = swModel

    Debug.Print "File = " & swModel.GetPathName

    Set swView = swDraw.GetFirstView

    Set swView = swView.GetNextView

        Debug.Print "  View = " + swView.Name

        Debug.Print "    Model  = " + swView.GetReferencedModelName

        Debug.Print "    Config = " + swView.ReferencedConfiguration

        swView.ReferencedConfiguration = "EHA400×6"

End Sub

'-------------------------------------

Private Sub del()

  Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2, Arr

    Set SwApp = Application.SldWorks

    Set SwModel = SwApp.ActiveDoc

   

    Debug.Print SwModel.GetPathName

    Debug.Print SwApp.GetActiveConfigurationName(SwModel.GetPathName)

    Arr = SwApp.GetConfigurationNames(SwModel.GetPathName)

    Stop

End Sub