Running into trouble when converting vba code
Posted: 07 May 2021, 10:33
I am converting this vba code to run in ahk.
So far I've been able to convert most of my macros over to ahk, but this one is giving me trouble. It seems that the line "Set pg = swModel.Extension.GetPackAndGo" fails unless swModel is defined ahead of time by "Dim swModel As SldWorks.ModelDoc2". This is the first time I've ran across this in their api, usually you can skip the definition but in this case it seems like it is required. Am I SOL or is there a way to initialize as that type in autohotkey?
Code: Select all
Set swApp = Application.SldWorks
'Dim swModel As SldWorks.ModelDoc2
Set swModel = swApp.ActiveDoc
Set pg = swModel.Extension.GetPackAndGo