BIM World
A Professional BIM Learning Platform


Mastering BIM: Exploring Reverse, Mirror, and Transform Techniques in Revit API

In this article, we will explore the Instance.GetTransform method in the Revit API.

Notably, the Instance.GetTransform method does not account for reflection. The image below shows a mirrored family instance alongside its corresponding transform value:

BIM Techniques | Exploring Revit API Reverse/Mirror/Transform

Here is the Python code example used:

import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

data = UnwrapElement(IN[0])
output = []

for i in data:
    output.append(i.Location.Point)
    output.append(i.GetTransform().BasisX)
    output.append(i.GetTransform().BasisY)
    output.append(i.GetTransform().BasisZ)
    output.append("")

OUT = output

This behavior is intentional within Revit. However, from a mathematical standpoint, this seems inconsistent. According to Wikipedia’s transformation matrix definitions, reflections along the X-axis should produce different transformation matrices:

BIM Techniques | Exploring Revit API Reverse/Mirror/Transform

Our investigation shows that Revit applies a combination of reflection and rotation to implement various mirroring and flipping operations:

BIM Techniques | Exploring Revit API Reverse/Mirror/Transform

It is important to distinguish between the horizontal double flip control on the same axis and the mirror command (highlighted in red). Though these operations appear almost identical graphically, the horizontal flips result in opposite facing directions and hand states. In other words, visually they look the same, but the actual facing direction differs.

Previously, I observed that a single flip control behaves more like a rotation than a mirror, since it does not produce a reflected geometric shape. While this is reflected in the transformation matrix, the facing direction remains unchanged. The manual state for this is also set to true.

Overall, I believe the facing direction and hand state are internal family management data. The internal geometry may be reflected, but the family instance itself is not—unless a transformation is explicitly applied.

To fully understand the behavior, you may need to check the flip status, rotation, and transformation properties. These controls were likely introduced long ago for door components to indicate the hinge side and swing direction. However, when these controls are applied to other elements, ambiguity arises—resulting in a kind of double negation where the final visual representation is the same, but defined in two different ways.

Original link: __AI_S_TURL_0__

xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat
Like(0) 打赏
BIM WORLD » Mastering BIM: Exploring Reverse, Mirror, and Transform Techniques in Revit API

Comment Get first!

Must log in before commenting!

 

BIM World, A Professional BIM Learning Platform

Stay updated on the latest architecture trends and share new building technologies.

Contact UsAbout Us

觉得文章有用就打赏一下小编吧

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Account Login

By signing in, you agree toUser Agreement

Sign Up