5 Replies Latest reply on May 5, 2016 6:22 PM by Filipe Venceslau

    Slow standalone application performance

    Vlad Shevchenko

      Hi everyone!


      I wrote simple add-in which collect information about geometry meshes and stores it into new file. In general it works quickly. It takes few seconds to convert simple model to my file format. Now I am trying to write standalone application which will connect to SolidWorks, load model and call my add-in. There were no problems with that, but when I do it via standalone application, performance of my add-in fell down. I made couple of test with simple models with SolidWorks in manual mode and as a rule it took me 20 seconds. The same models via standalone application took more then 5-10 minutes.

      I noticed that when i launch SolidWorks via standalone application and then launch my add-in, it will be launched in background mode (I will be able to rotate model and build new geometry). But when I launch my add-in from SolidWorks (manually press button) the UI stop response until my add-in will not finished converting. Maybe there are exists some switches for such case as my. I do not need to use SolidWorks UI and i set swApp.Visible = false but it doesn't increase performance. Have you any ideas?


      Have a nice day.

        • Re: Slow standalone application performance
          Filipe Venceslau

          Hi Vlad,


          There are a few ISldWorks properties you can change, just like ISldWorks.Visible as you already mentioned as well as ISldWorks.UserControl for example. I think you will find that this will not make a big difference however, since I believe your problem is likely related to all the marshaling overhead involved with connecting to SolidWorks from an external application. When your code runs within a SolidWorks add-in, it is in the same memory-space as the SolidWorks application itself and marshaling is not necessary, allowing the API to respond much quicker than it would from an external application invoking all the same methods (requiring marshaling).


          If you really need an external application, then you might want to consider creating a Solidworks addin solely for the purpose of running the API related code and then have the external app talk to that addin instead. In this manner, you can still leverage the speed from being closely connected to SolidWorks application and only send the processed data back to your external application.


          Hope this helps,



            • Re: Slow standalone application performance
              Vlad Shevchenko

              Thank for your reply. Yes, I used ISldWorks.UserControl and I didn't notice any difference. I really need to use external application to run my addin. My addin has one method which returns string (path to created file), there is just one call from external application to SolidWorks. Maybe the problem related with loading addin into SolidWorks. I use for this purpose ISldWorks.LoadAddIn.  But when my external application connected to already launched SolidWorks, I able to get addin instance without loading it (ISldWorks.GetAddInObject), but it hasn't any difference in performance.