AnsweredAssumed Answered

RunMacro2→deliver function (parameter)?

Question asked by Yong Ning on Jul 11, 2017
Latest reply on Jul 11, 2017 by Nilesh Patel

follow code don't use function parameter ?

don't  RunMacro.swp parameter → deliver → RunMacroSub.swp

**************************************************************************

 

Help me. swApp.RunMacro2 → deliver parameter → function aa(parameter1,parameter2,parameter3)

Function aa(Str)

    MsgBox Str

end function

 

 

***************************************

2015 SOLIDWORKS API Help - RunMacro2 Method (ISldWorks)  http://help.solidworks.com/2015/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.isldworks~runmacro2.html

 

 

 

'----------------------------

' RunMacro.swp

'---------------------------

Option Explicit

Dim swApp As SldWorks.SldWorks

Dim boolstatus As Boolean

Sub main()

Set swApp = Application.SldWorks

Dim runMacroError As Long

boolstatus = swApp.RunMacro2("f:\test\RunMacroSub.swp", "RunMacroSub1", "main", swRunMacroUnloadAfterRun, runMacroError)

End Sub

'---------------------------

 

 

 

 

'---------------------------------------

' RunMacroSub.swp'

'---------------------------------------

Sub main()

Set swApp = Application.SldWorks

swApp.SendMsgToUser "RunMacroSub1:main() called."

End Sub

Outcomes