Scripting challange

Hello,

We are getting stuck on a scripting challange for Rh5. We want to pull a mesh outline to a curve somewhat like is shown in the video added to this post at 1.42 min. This is the last puzzel in a script to make it complete.

If anyone had some bright ideas please advice, it would really help us on the way.