Run standalone application from a SWP macro

Hi everyone,

I would like to run a standalone C# application from a VBA SWP launcher by passing the SolidWorks process id as argument in case of multiple SolidWorks instances.

macro.swp (VBA launcher)

---------------------------------------------------------------------------------------------------------

Sub Main()<br>    Shell """C:\\...\\macro.exe"" " + CStr(Application.SldWorks.GetProcessID)<br>End Sub

macro.exe (C# standalone application)

---------------------------------------------------------------------------------------------------------

static void Main(string[] args)<br> {<br>    int processId = Convert.ToInt32(args[0]);<br>    Process process = Process.GetProcessById(processId);<br>    // How to get SldWorks instance from process?<br>}

Need help

Best regards

SolidworksApi macros