I have converted most of my macros over to autohotkey, but am having trouble with the GetPackAndGo command. Autohotkey is an untyped language that can run vba macro code with only a few syntax changes. I kept getting the error 'parameter not optional' in ahk and 'argument not optional' in macro.
Code: Select all
'Dim swModel As SldWorks.ModelDoc2
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swPackAndGo = swModel.Extension.GetPackAndGo() 'error here
Debug.Print swPackAndGo.GetDocumentNamesCount()
Uncommenting the swModel declaration fixes the problem in macro. The problem is I can not specify the variable type in Autohotkey. I am not sure what exactly is happening when that variable gets defined, but normally you can just skip that step unless you want auto-completion.
Anyone else have experience with this?