Transform from instance Plane

In Revit API, how can I get Autodesk.Revit.DB.Transform by knowing the final Plane of where the instance should be inserted?

There is a solution which calculates Transform from normal vector of the final plane. But I would need to consider all three axes of the final plane, not only its normal.

Basically I created a DirectShapeType at 0,0,0 lying in the XY plane. And now I would like to instantiate it to some plane in 3D. I know this plane in 3D, but I do not know how to create Autodesk.Revit.DB.Transform for it:

Maybe obtaining the yaw, pitch, roll angles somehow, but sadly even with this information, Autodesk.Revit.DB.Transform does not allow to manually set the transformation matrix parameters.
Any help would be appreciated, as I don’t know how to solve this problem.

Just create a new Transform and set its Origin, BasisX, BasixY and BasiZ to the planes origin, normal, x and y axes.

3 Likes

Hi @Thomas_Mahon ,
Thank you very much for the advice.
My apologies for not posting in any other language, but I assume in python it would like this?

# create transformation for XY pln to final 'pln'
transform = rdb.Transform.Identity  # instantiate transformation

transform.Origin = XYZ(pln.Origin.X, pln.Origin.Y, pln.Origin.Z)  # assign origin pt
transform.BasisX = XYZ(pln.XVec.X, pln.XVec.Y, pln.XVec.Z)  # assign Basis X vector
transform.BasisY = XYZ(pln.YVec.X, pln.YVec.Y, pln.YVec.Z)  # assign Basis Y vector
transform.BasisZ = XYZ(pln.Normal.X, pln.Normal.Y, pln.Normal.Z)  # assign Basis Z vector

Did I understand you correctly?