One idea I have is that you get the relations for the all offsets and then let the code select those two segments in the relation. Once selected (or identified...) you can use the IModelDoc2::ClosestDistance method. It is not that sweet but it does the job.... I modified a macro that is in the API reference so the macro only gets the offset relations and then measures the distances between the related segments.
Had to add a Round function to it... for some reason it plotted the distance to be 9.9999999mm when it was actually 10mm. So there is something not working properly... Note that I did not debug the macro properly, since it is just to show how it might be done... scripts is out of range time to time etc. etc... Did some tries to debug... but gave up since it just to show the idea.
You could do this the other way around if you know your specific ID of the segment, then you could loop thru all offset relations until you find a match that has a relation to the specified ID. By doing that you do not have to get all offsets as in the macro...
I also found this post, which would have been a much better approach...
Macro1.zip 15.8 KB
thank you for the anware..
I tried with a recursion of the all the dimensions in the sketch, and after I select it.
This in, in my opinion, the more safe way.
Thank you very much.