Revit Element Transformation Matrix


#1

Is it possible to get the transformation matrix, or local coordinate system of a Revit Element, for example a face based Family Instance?
I’d like to put them out to excel, so I can generate elements by them in 3ds max.
I’ve only managed to get the Normal vector of an Element, which is not enough to get the exact transformation of an object.


#2

Can you clarify what you mean by 'transformation matrix or local coordinate system of a Revit element ’

Depending what sort of family it is- it will have a host and a location (XYZ)


#3

Hi Andrew,

By transform matrix I mean, I would like to have the object’s local coordinate system’s defined by X, Y and Z unit vectors.

See attached picture (sorry for the poor sketch): for example, if I have a face based object, placed on a wall, so it’s normal vector is paralell to world X, the Z unit vector is [1,0,0]. However, if the face based object is rotated as well on the wall, for example 30 degrees around, the Z unit vector is the same [1,0,0], but the X and Y differ (they are sin and cos values of the rotation value). So by this, I mean that the Z normal vector is not sufficient to define the object’s transformation, I need X and Y as well.

I hope this helps to explain my problem.


#4

Working with the coordinate systems and it’s vectors means no problem:

I just can’t extract the Local Coordinate system from the the Revit Family Instance.


#5

I couldn’t find a working Dynamo node for it, but I managed to do it:

You can get the X axis by Python command “HandOrientation”:
.append(objInstance.HandOrientation.ToVector()

This gives me the X unit vector of an object. So from from X and Z, the third unit vector (Y) can be figured out by rotating the Z vector around the X axis by 90 or -90 degrees (you only have to watch over the object being mirrored or not).

Thanks anyway for your answer!