If the pipe lies on a single plane then it's pretty easy. If it's on multiple planes then it gets more difficult. Haven't run into that issue so I'm not sure how I'd approach it.
there was the same question last week, or at least for me it sounds as being the same.
"How to get the length of an imported pipe"
I have added a video there.
Here under android I'm not able to copy the link to that post.
But just scroll back to last weeks items.