I am trying to get the design table to update and add the new config after it is added. AutoAddNewConfigs sounds like it should do just that "Gets or sets whether to automatically add rows or columns to the design table when new configurations are added to the model." I have it set to true and the design table pops up but the new config is not added. Am I misunderstanding what AutoAddNewConfigs does or just using it wrong?
Thanks.
David
Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim ConfigList As Variant Dim i As Integer Dim myConfigToTest As String Dim doesItExist As Boolean Dim swDT As SldWorks.DesignTable Private Sub AddPartButton_Click() 'Connect to SolidWorks, the active document, and Design Table Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc Set swDT = swModel.GetDesignTable 'Set new config to test myConfigToTest = UCase(PartNoInput.Text) doesItExists = False 'Get list of configurations ConfigList = swModel.GetConfigurationNames 'Test if configList contains user input. For i = 0 To UBound(ConfigList) If ConfigList(i) = myConfigToTest Then doesItExist = True Next If doesItExist Then MsgBox "That part number already exists." Exit Sub End If 'Add new config and update design table swDT.Attach swDT.AutoAddNewConfigs = True swModel.AddConfiguration3 myConfigToTest, Empty, Empty, 0 swModel.ForceRebuild3 True End Sub