Hi
1- I needed to create a macro where it is possible to rename the active configuration with the same file name, how can I do this? 2 - Possible when saving a document to run the macro together?
Hi
1- I needed to create a macro where it is possible to rename the active configuration with the same file name, how can I do this? 2 - Possible when saving a document to run the macro together?
Here is a very rough macro to get you started.
Dim swApp As SldWorks.SldWorks
Dim swMdlDoc As SldWorks.ModelDoc2
Dim swConfigMgr As SldWorks.ConfigurationManager
Dim swConfig As SldWorks.Configuration
Sub main()
Set swApp = Application.SldWorks
Set swMdlDoc = swApp.ActiveDoc
Set swConfigMgr = swMdlDoc.ConfigurationManager
Set swConfig = swConfigMgr.ActiveConfiguration
swConfig.Name = swMdlDoc.GetTitle
Set swApp = Nothing
Set swMdlDoc = Nothing
Set swConfigMgr = Nothing
Set swConfig = Nothing
End Sub