Place coordinate systems on surface with their scale factor and rotation

Hi everyone,
I have a problem with Surface.CoordinateSystemAtParameter, I have a set of coordinate systems which is scaled and rotated, while I not used Surface.CoordinateSystemAtParameter all works fine, but after used Surface.CoordinateSystemAtParameter coordinate systems lose their scaling and rotation.
I need to place coordinate systems on surface with their scale factor and rotation.
For move up coordinate systems on surface I use ZeroTouch library.

public static CoordinateSystem CoordinateSystemOnSurface(Surface surface, CoordinateSystem cs)
            var identity = CoordinateSystem.Identity();

            var csAtParam = surface.CoordinateSystemAtParameter(cs.Origin.X, cs.Origin.Y);

            var newCs = identity.Transform(csAtParam); 

            return newCs;

CoordinateSystemOnSurface (12.1 KB)

Please indicate where I could make a mistake.
I will be grateful for any tips or hints.

Try creating the coordinTe system and then applying the transforms afterwards?

Hi, JacobSmall
Could you please tell a little bit more what you mind? Because I newbie to using Dynamo, and Transformation for me is a little bit harder for understanding.

You’re doing all your transforms first, then trying to apply it to a surface. Better to define the coordinate system on the surface and THEN make your modifications.

Thenks for the helping, JacobSmall