Cplane to World

Could some one tell me why this isn’t working. So I have a custom cplane that aligns with an object and would like to transform that object to the world xy plane. So I used the xformChangeBase() to get a transform matrix then try to input that int the transformObjects()

import rhinoscriptsyntax as rs

Objs = rs.GetObjects('Select Objects')
Cplane = rs.ViewCPlane()
TransM = rs.XformChangeBasis(Cplane,rs.WorldXYPlane())
TransObj = rs.TransformObjects(Objs,TransM,True)

Try to change this line:

TransM = rs.XformChangeBasis(Cplane,rs.WorldXYPlane())

to this:

TransM = rs.XformChangeBasis(rs.WorldXYPlane(), Cplane)


Awesome. Worked.

Huh I thought the initial plane would be the “from” plane and the final plane would be the “to” plane. Bad assumption.

Yes, it is a bit confusing but correct.

rs.XformCPlaneToWorld() and rs.XformWorldToCPlane()

behave similar, we just need to swap both brain halves to get used to it. :wink:



Thanks again for the help. Was finally able to get my BlockFromCplane script up and going.