4 Replies Latest reply on Jun 16, 2017 5:54 PM by Jorn Bjarning

    Create new instance of SOLIDWORKS

    Jorn Bjarning

      Hi,

       

      It seems so basic that I almost can't believe I am asking this, but I am stuck and I need a little input. Normally when developing SOLIDWORKS applications you want the application to connect to an existing instance (session) of SOLIDWORKS - if running. And then if not - you will create an instance. I have a request for a SOLIDWORKS application where a new instance of SOLIDWORKS should always be created. No matter if SOLIDWORKS is already running or not.

       

      And why do I want that? The application is a task-scheduler-like application which is supposed to work hidden and silent for the user (generating PDF etc.) while the user can continue to work with SOLIDWORKS in another session.

       

      I thought that using...

       

      swApp = CreateObject("SldWorks.Application")

       

       

      ... would ALWAYS create a new instance of SOLIDWORKS, but it doesn't. I have tried all the other methods I know of to create the swApp object but they all connect to the existing SOLIDWORKS session instead of creating a new one. It's funny I have read many posts where the problem was the creation of a second instance where connection to an existing session was wanted - but I didn't find any useful information in these posts that i could use.

       

      A work around might be to have the user start the second session of SOLIDWORKS first and then start the application but I would prefer to have the application start the second SOLIDWORKS instance.

       

      Any ideas?