Can someone help me with the macro below. The macro opens a part, then changes the "Serial" custom property, then saves the file as "Serial" and the number in the customer property. I am trying to figure out how to auto change this number. I have 100 parts to change this note, and it would be nice to run a macro to auto change the custom property, then save it as a file with "Serial000001.sldprt, Serial000002.sldprt, etc etc)
Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean Dim longstatus As Long Dim Annotation As Object Dim Gtol As Object Dim DatumTag As Object Dim FeatureData As Object Dim Feature As Object Dim Component As Object Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.OpenDoc4("serial.SLDPRT", 1, 0, "", longstatus) Set Part = swApp.ActivateDoc("serial.SLDPRT") retval = Part.AddCustomInfo3(EmptyStr, "Serial", 30, "0000001") Part.EditRebuild Part.SaveAs2 "serial000001.SLDPRT", 0, False, False swApp.CloseDoc "serial000001.SLDPRT" End Sub