AnsweredAssumed Answered

Prompt user to enter a configuration name using a macro

Question asked by Stephen Bond on Feb 19, 2019
Latest reply on Apr 18, 2019 by Abhishek Lad

I am writing a macro that creates a new configuration in an assembly and automatically unchecks 'Suppress New Features and Mates'. However, the macro only works with a preselected configuration name. Currently, my macro creates a new configuration called 'default3' but I would like a userform to pop up and prompt the user to enter a configuration name. Here is my code so far:


Dim swApp As SldWorks.SldWorks


Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long


Sub main()


Set swApp = Application.SldWorks


Set Part = swApp.ActiveDoc

boolstatus = Part.Extension.SelectByID2("Default", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)

boolstatus = Part.EditConfiguration3("Default", "Default", "", "", 32)


Part.ClearSelection2 True

boolstatus = Part.AddConfiguration2("default3", "", "", False, False, False, True, 256)

End Sub


Anyone have any recommendations? Thanks,