Hope activate use named configuration with API.
Use this method: http://help.solidworks.com/2010/English/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.iview~referencedconfiguration.html
Here is teh example: http://help.solidworks.com/2010/English/api/sldworksapi/Get_Configurations_Referenced_in_View_Example_VB.htm
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
Use this method: http://help.solidworks.com/2010/English/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.iview~referencedconfiguration.html
Here is teh example: http://help.solidworks.com/2010/English/api/sldworksapi/Get_Configurations_Referenced_in_View_Example_VB.htm
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