3 Replies Latest reply on Jun 12, 2017 11:24 AM by Deepak Gupta

    How to convert a macro to batch run

    Richard Woodward

      Apologies if this has been asked numerous times before, but I am having trouble in following how to convert a macro to batch run. The macro in question creates a new custom property;

       

      Dim swApp As SldWorks.SldWorks

      Dim swModel As SldWorks.ModelDoc2

      Dim swCustPropMgr As SldWorks.CustomPropertyManager

       

      Sub main()

      Set swApp = Application.SldWorks

      Set swModel = swApp.ActiveDoc

      Set swCustPropMgr = swModel.Extension.CustomPropertyManager("")

      swCustPropMgr.Add3 "Description", swCustomInfoText, "COLUMN WELDMENT", swCustomPropertyReplaceValue

      End Sub

       

      Basically I want to convert it to run on all of the files in a particular folder. I have a number of other macros which I also need to modify, but rather than ask someone to just do it for me, I wondered if there was a simple set of instruction to follow in order to achieve this? Unfortunately my programming knowledge is extremely limited so was wondering if there is some kind of dummies guide to cover this?

       

      Thanks in advance

       

      Rich