Skip to content

Add Windows.Direction node for window facing direction#80

Merged
johnpierson merged 2 commits intomasterfrom
copilot/add-window-direction-node
Jan 12, 2026
Merged

Add Windows.Direction node for window facing direction#80
johnpierson merged 2 commits intomasterfrom
copilot/add-window-direction-node

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

Adds Windows.Direction node to get window facing direction, parallel to existing Walls.Direction functionality.

Implementation

  • New file: src/RhythmRevit/Revit/Elements/Windows.cs
  • Returns: Multi-value output with facingDirection (cardinal string: N, NE, E, etc.) and facingVector (XYZ)
  • Primary method: Uses FamilyInstance.FacingOrientation property native to window elements
  • Fallback: Transform's BasisY for edge cases where FacingOrientation unavailable
  • Direction calculation: Reuses Walls.Direction angle-to-cardinal logic for consistency

Usage

// Input: Window element (FamilyInstance)
Windows.Direction(windowElement)

// Output: 
// - facingDirection: "N", "NE", "E", "SE", "S", "SW", "W", "NW"
// - facingVector: XYZ vector

Windows are FamilyInstance elements in Revit with explicit FacingOrientation, unlike walls which compute direction from location curves. The implementation adapts to this fundamental difference while maintaining API consistency.

Original prompt

This section details on the original issue you should resolve

<issue_title>Windows.Direction</issue_title>
<issue_description>What is the problem that needs solving?
Node to get window direction (like walls.direction)

How would you like to see it solved?
New node based on walls.direction logic

Describe alternatives you've considered
I've done this before with OOTB nodes.

Additional context
image
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: johnpierson <15744724+johnpierson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new node to retrieve window direction Add Windows.Direction node for window facing direction Jan 12, 2026
Copilot AI requested a review from johnpierson January 12, 2026 18:30
Copy link
Owner

@johnpierson johnpierson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 😎

@johnpierson johnpierson marked this pull request as ready for review January 12, 2026 18:48
@johnpierson johnpierson merged commit 44c270e into master Jan 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows.Direction

2 participants