The Surface entity in Eyeshot contains a list of trim loops as a collection of curves properly oriented (counter-clockwise for outer one, clockwise for inners).
To check if the surface is trimmed you can query the mySurf.Trimmed property. To loop over loops or loop curves use the mySurf.Trimming.ContourList property as you can see in the code snippet below.
The following code snippet demonstrates how to extract surface edge curves from the entity ent and to add them to the ViewportLayout master entity collection with red color.