Create ViewSection from inclined surface – section always appears vertical even when transform basis is correct
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I’m creating Revit Sections via Python (Revit 2024) using ViewSection_CreateSection, and I’m stuck at a behavior that seems inconsistent between mathematical transform correctness and Revit’s final section orientation.
I would really appreciate insight from anyone who has deep experience with section view transforms.
I want to:
Create a section view that looks straight at an inclined bottom surface
The section plane is defined by a surface normal
A curve lying on that surface should define the horizontal direction on screen
Result:
The surface should appear “flat”
The curve should be horizontal on screen
This works only when the surface is horizontal.
As soon as the surface is inclined in 3D, the resulting section view becomes vertical on screen, even though the transform basis seems correct.
curve : Dynamo curve lying on the surface
surfaceNormal : normal vector of the surface (correct direction)
midpoint : center of section
Logic:
# View normal (look direction)
viewZ = surfaceNormal.Normalize()
# Curve direction (should be horizontal on screen)
viewX = curveDirection.Normalize()
# Up direction
viewY = viewZ.CrossProduct(viewX).Normalize()
# Re-orthogonalize
viewX = viewY.CrossProduct(viewZ).Normalize()
# Build transform
t = Transform.Identity
t.Origin = midpoint
t.BasisX = viewX
t.BasisY = viewY
t.BasisZ = viewZ
Everything is geometrically correct, but Revit seems to reinterpret or clamp the section orientation, especially when the surface is inclined.
I’m trying to understand whether:
This is a limitation
A missing constraint
Or a wrong assumption about how section transforms work
Any insight would be greatly appreciated 🙏