2 Replies Latest reply on Mar 30, 2017 5:33 PM by Marco Wu

    Does my MACRO syntax have problem?

    Marco Wu

      I write my first SWP macro. It is just a button to set the properties.  The problems are

      1. the user form does not show every time

      2. There should have some problems in the syntax

       

      The swp file is attached

      If you don't want to download the file , here is the code. Please help

      ================================================

      Option Explicit

       

      Sub main()

      Dim swApp As SldWorks.SldWorks

      Dim swModel As SldWorks.ModelDoc2

      Dim swCustPropMgr As SldWorks.CustomPropertyManager

      End Sub

       

      Public Sub ALUM(promgr As CustomPropertyManager)

      promgr.Add3 "MYMATERIAL", swCustomInfoText, "AAAA", swCustomPropertyReplaceValue

      promgr.Add3 "MYDATE", swCustomInfoDate, "07/02/2015", swCustomPropertyReplaceValue

      End

      End Sub

      ============================================

      Private Sub ALUM_BUTTON_Click()

      Call ALUM(swCustPropMgr)

      End

      End Sub

      ========================================