Extract Centerline Of Free Form Tube Returns Circular Length as Centerline

When I apply the Extract Centerline Of Free Form Tube (http://www.nxjournaling.com/content/extract-centerline-free-form-tube) for Face Bodies/Sheet Bodies, the application creates the centerline as mid-circular length instead of the normal line. This seems to happen when the tubes have very short lengths.

Please help me fix this problem - here is the example

http://i63.tinypic.com/15302hg.png

There is an old thread on the Siemens community site on this topic (it may be where this code originated); you may want to look at yamada's version as it will handle faces with different UV directions.

https://community.plm.automation.siemens.com/t5/NX-Design-Forum/Measure-...

Thanks - I would prefer to have .NET solution but SNAP is also fine

I think there is some confusion here. SNAP works with .net, it is not an independent language. SNAP mostly "sugarcoats" the API commands to make them easier to use. The code in the link that I provided has a function called "GetTubeDirection" that solves the problem you posted about. It does use some SNAP versions of functions, but the command is well documented and does nothing that cannot be done with the standard NXOpen API. You can easily rewrite this code to eliminate the SNAP function calls if you so desire.

I got it now and it actually eliminate some of the errors with the pure .NET Open code. Thanks - I seem to catch up with what I need to do in order to solve my ultimate problem