Skip to content

Query.Space - find closest space added#1641

Open
michal-pekacki wants to merge 5 commits intodevelopfrom
Revit_Schematic_Tool-#154-FindNearestSpace
Open

Query.Space - find closest space added#1641
michal-pekacki wants to merge 5 commits intodevelopfrom
Revit_Schematic_Tool-#154-FindNearestSpace

Conversation

@michal-pekacki
Copy link
Contributor

NOTE: Depends on

Issues addressed by this PR

Closes #

Added a mechanism to find closest space for elements that are physically outside the space (e.g. air terminals located above the space or fire dampers located in the walls between spaces).

Test files

Changelog

Additional comments

@michal-pekacki michal-pekacki self-assigned this Feb 20, 2026
@michal-pekacki michal-pekacki added the type:feature New capability or enhancement label Feb 20, 2026
pawelbaran
pawelbaran previously approved these changes Feb 24, 2026
Copy link
Member

@pawelbaran pawelbaran left a comment

Choose a reason for hiding this comment

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

Passing on the approval from @JanineConway 👍

@pawelbaran
Copy link
Member

@BHoMBot check ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 24, 2026

@pawelbaran to confirm, the following actions are now queued:

  • check ready-to-merge

Rework Space lookup logic to better handle FamilyInstances and linked documents. Key changes:
- Early return for FamilyInstance.Space when FI has no spatial calculation point.
- Use element.LocationPoint(false) for primary location and apply linked-document transform to the point before containment tests.
- Defer collecting spaces until after transforming the location point; still populate m_LinkTransforms for spaces from linked docs.
- Only use room calculation point when FI has a spatial calculation point and useRoomCalculationPoint is true; prefer fi.Space when available.
- Adjust comment numbering and preserve existing fallback strategies (connector-based nearest space and searching below).
These changes ensure correct space resolution for elements coming from linked models and for family instances with or without calculation points.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New capability or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants