I made an add-in to get the length of a selected pipe, and add up the lengths of any other selected pipes. I also made it so tube lengths can be calculated as such. However, my problem begins with bends. I made an equation that calculates the arc-length and adds up the lengths of the legs. However, when there are a bunch of tube sections my performance slows down quite a bit. I'm using solidworks 2013, so path length isn't available. Is there a faster way of getting the arc length and adding up the legs than making an equation for each tube section?
Right now the add-in reads the selection. It checks if a there exists a dimension named "tube length" or "pipe length". When it finds it, it adds it to the total length. Then it goes through the rest of the selections.
Another problem I'm having is: when I select a surface that's on the same part my add-in double counts the length. I tried to check if the internal ID matches the parts ID then don't count it again, but it isn't working. Is there another way to check if the surface belongs to a part that's already selected?
SolidworksApi macros