I would like to modify the macro I already have for deleting out configuration properties - I currently have to have the file open and and run the macro. Would it be possible to modify the macro so that whatever folder the macro is in, it would open any parts or assemblies, delete out configuration properties, rebuild, save and close?
My plan is to use this macro with the task scheduler to process multiple files at an off peak time. My current macro is below:-
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swCustPropMgr As SldWorks.CustomPropertyManager
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Dim vConfs As Variant
Dim i As Integer
vConfs = swModel.GetConfigurationNames
For i = 0 To UBound(vConfs)
Debug.Print "Main: " & vConfs(i)
If vConfs(i) <> "Custom" Then ClearCustPrps (vConfs(i))
Sub ClearCustPrps(conf As String)
Dim j As Integer
Set swCustPropMgr = swModel.Extension.CustomPropertyManager(conf)
If Not swCustPropMgr Is Nothing Then
swCustPropMgr.GetAll vPropNames, Empty, Empty
If Not IsEmpty(vPropNames) Then
For j = 0 To UBound(vPropNames)
Debug.Print "ClearCustPrps: " & vPropNames(j)
swModel.ShowNamedView2 "*Isometric", -1
MsgBox "The Configuration Properties Have Been Successfully Deleted, The Model Has Been Rebuilt and Saved"
Thanks in advance.