AnsweredAssumed Answered

Calculate distance between points in differents sketches SolidWorks API

Question asked by Vincent Audet on Jul 13, 2015
Latest reply on Jul 13, 2015 by Vincent Audet

I have been working on a script for the application SolidWorks since about a month and a half and I would like to make it better since it is pretty slow.

What my script does :
1. It tells the user to select some specific component (using advanced Select).
2. It makes a collection out of those components.
3. It makes a collection out of those collection because I need them regroup depending of their configuration.
4. In every component is a sketch with a single sketchPoint. I have to calculate the distance between this point and the origin of a predetermine point in a 3D sketch. So I bring the sketchPoint attach to my component into my 3Dsketch, I calculate, then I delete it.
5. I Do this for every component (60++)

The time consuming part is the one where I have to Edit my 3DSketch, bring one point into it, Close the edition, calculate the distance, Edit, delete, close again.

I am currently doing a more oriented object approach so no more collection of collection, but still my problem stay. I was wondering if the IMath could be useful since I've seen this
but it does seems to work properly.

Ah and I am aware of the measure tool but it won't work since I need the negative value if my sketchPoint is "behind" my origin.

Thank you