Skip to content

Level property not found properly - #1685

Merged
michal-pekacki merged 2 commits into
developfrom
Revit_Toolkit-#1684-LevelPropertyNotFoundProperly
Aug 4, 2026
Merged

Level property not found properly#1685
michal-pekacki merged 2 commits into
developfrom
Revit_Toolkit-#1684-LevelPropertyNotFoundProperly

Conversation

@adam-sobieski

Copy link
Copy Markdown
Contributor

Level.cs: introduce a local Level variable and change lookup flow to prefer LevelParameter and family host, then fall back to Document.LevelBelow(location) instead of returning null. LevelParameter.cs: adjust LINQ selection to use ThenByDescending on IsReadOnly and call FirstOrDefault() (remove predicate) so the candidate is chosen via ordered ranking (valid ElementIds first, then read-only ordering). This makes level resolution more robust and centralizes parameter selection logic.

NOTE: Depends on

Issues addressed by this PR

Closes #1684

Test files

Changelog

Additional comments

Level.cs: introduce a local Level variable and change lookup flow to prefer LevelParameter and family host, then fall back to Document.LevelBelow(location) instead of returning null. LevelParameter.cs: adjust LINQ selection to use ThenByDescending on IsReadOnly and call FirstOrDefault() (remove predicate) so the candidate is chosen via ordered ranking (valid ElementIds first, then read-only ordering). This makes level resolution more robust and centralizes parameter selection logic.
@adam-sobieski adam-sobieski self-assigned this Aug 3, 2026
@adam-sobieski adam-sobieski added the type:bug Error or unexpected behaviour label Aug 3, 2026
Comment thread Revit_Core_Engine/Query/Level.cs Outdated

@michal-pekacki michal-pekacki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes make sense, happy to approve 👍

@adam-sobieski

Copy link
Copy Markdown
Contributor Author

@BHoMBot check required

@michal-pekacki

Copy link
Copy Markdown
Contributor

@BHoMBot check versioning

@bhombot-ci

bhombot-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

@michal-pekacki to confirm, the following actions are now queued:

  • check versioning

There are 3 requests in the queue ahead of you.

@michal-pekacki

Copy link
Copy Markdown
Contributor

@BHoMBot check ready-to-merge

@bhombot-ci

bhombot-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

@michal-pekacki to confirm, the following actions are now queued:

  • check ready-to-merge

There are 3 requests in the queue ahead of you.

@michal-pekacki
michal-pekacki merged commit 827caf1 into develop Aug 4, 2026
28 of 29 checks passed
@michal-pekacki
michal-pekacki deleted the Revit_Toolkit-#1684-LevelPropertyNotFoundProperly branch August 4, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Error or unexpected behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Level property not found properly

2 participants