Rotate any 3D curve

Hi All,

How to rotate any 3D curve flat/parallel to XY plane.

For example, consider any line that is rotated on all planes so I would like to make it flat.

One method was pulling curve to flat surface and remove it and re scale it but what if its circle or rectangle curve rotated?

You could it with this steps: 1) use isplanar to get a plane on your curve 2)orient the curve with that plane