4 Replies Latest reply on Oct 4, 2018 9:38 AM by Marco Maso

    ISwAddin extremely slow

    Marco Maso

      I created an add-in using iSwAddin as suggested in the Solidworks API docs.


      I know that COM operations are usually slower but the add-in is painfully slow and I'm starting to think there's something wrong.


      My add-in basically:

      1. Select a plane and a surface

      2. Create a new sketch containing the intersection between the plane and the surface

      3. Create several new geometries (mostly offsets) based on the intersecting splines (we are talking in the order of 50-60 new sketch segments)


      These operations require almost 3 hours..


      I'm using the usual tricks to improve performance such as disabling the view, the controls, the tree updates and so on. Via debugging I can't see any memory problem regarding my code.


      Is there something else I should be aware of? Thanks in advance.

        • Re: ISwAddin extremely slow
          Artem Taturevych

          What programming language are you using?

            • Re: ISwAddin extremely slow
              Marco Maso

              Everything is in C#


              I also tried running in debug and release mode but there is no noticeable difference.


              Edit: I forgot to mention that I'm usually adding ~250 reference planes in the file for other purposes, so there is a total of ~250 ref planes and around 3-4 sketches with ~60 sketch segments inside.

                • Re: ISwAddin extremely slow
                  Artem Taturevych

                  I have created sample add-in which emulates your workflow (please find attached). Could you please try it from your end. Basically I want to understand is it something with your SOLIDWORKS, model or code which makes it slow.


                  The add-in adds the button to command manager

                  When you click PMP appears, you need to select plane and face

                  As the result intersection curve is created and offsets as well. For me it took 40 seconds to generate based on the sample model attached.

                  Try it on the attached model, What is the result. Try it on your model, what is the result?


                  And also could you please clarify the main functionality of the add-in? Are those planes create for construction purpose or you need to have them in the model explicitly?

                    • Re: ISwAddin extremely slow
                      Marco Maso

                      I appreciate your answer. I tried your add-in and it took around 80 seconds on my machine.




                      A lot of time but still in the "human" range. This is on a Windows 10 desktop with Intel Xeon CPU and 24GB ram.


                      The planes are created for construction purposes but I have been asked to leave them in the model for further testings.


                      I'm trying to test on another clean desktop with a simplified model and add-in code I can openly share. Will update as soon as possible.