What code fit elipse to points made from elipse projected to mesh

Hi,
V8
draw half an elipse, project it to a mesh that is an elipse (end of a fuel tank)
get a wriggly elipse.
I already have a button with code for fit circle or fit line to divide 30 a circle or line.
now I need fit elipse to 30 points.

divide pause 30 enter enter
SelLast
circle fitpoints enter
delete

Divide30_CircleFit

what would the code be for this ?
Cant ask Pascal as hes moved on , so any ‘Pascal equals’ out there ?

I can then make a button.
here is the file.
fit elipse to divide 30 points.3dm (2.6 MB)

Cheers

Steve

Hi Steve,

Well, you’ve asked this before and now your perseverance pays off:

McNeel have added an ellipse ‘fit to points’ option to the WIP, so you’ll be able to do this in Rhino 9. I’ve saved the result as an R8 file for you:
fit elipse to divide 30 points 001.3dm (489.6 KB)

Kudos to @dale for this.

HTH
Jeremy

Hi Jeremy,
Thats excellent news, I will update v9 and make use. :heart_eyes:
Steve