the easy way to judge if certain Configuration is exist?

Dear all

I want to know, How to judge if configuration name "AAA" is exist?

if not exist,then use

ConfigMgr.AddConfiguration to add this configuration

if exist ,then activate this configuration

is there any  simplest way? the easier the better

zhengjun yuan

SolidworksApi macros
Answers 2
SF
SF 2012-02-08 Best Answer

Hi Zhengjun Yuan,

Use GetConfigurationNames method which will give you name of all the configurations present.

or

GetConfigurationByName method and you can use specific name to find whether that exists or not.

Regards,

SF
SF 2012-02-08

Thanks, it did great now

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
Dim value As Object
Dim aaa As String
aaa = "WN2"
Set value = Part.GetConfigurationByName(aaa)

If Not value Is Nothing Then
Else

Set value = Part.AddConfiguration3(aaa, "", "", 0)


End If