feature for loft surface

I would like to create a feature that generate a surface as in the attached image.

The single points for the two external curves, are calculated from the user parameters input in interface

But I can not find the sequence of function to call for the feature

1) I thought to use modeler.createLine to create all the hyphens that join the points identified

but I can not combine them all into a single spline

2) I tried to do two individual hyphens to see if I could make an loft surface

but i get an error 'System.AccessViolationException' Attempted to read or write protected memory

when i call Modeler.CreateLoftSurface

someone has better ideas or tips?

available to share more info

thanks a lot

Karim

SolidworksApi macros