AnsweredAssumed Answered

Does my MACRO syntax have problem?

Question asked by Marco Wu on Mar 30, 2017
Latest reply on Mar 30, 2017 by 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 Sub


Private Sub ALUM_BUTTON_Click()

Call ALUM(swCustPropMgr)


End Sub