Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Revit_Core_Engine/Query/LevelParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static partial class Query

[Description("Returns the element parameter that stores the level of the element. Checks multiple built-in level parameters in order of preference.")]
[Input("element", "Element to get the level parameter from.")]
[Output("parameter", "Parameter that stores the level, or null if not found or parameter is read-only.")]
[Output("parameter", "Level parameter of the element, or null if not found.")]
public static Parameter LevelParameter(this Element element)
{
if (element == null)
Expand All @@ -45,15 +45,15 @@ public static Parameter LevelParameter(this Element element)
.Select(x => element.get_Parameter(x))
.Where(x => x != null)
.OrderByDescending(x => x.AsElementId().Value() != -1) // Valid ElementIds first
.ThenByDescending(x => x.IsReadOnly)
.ThenBy(x => x.IsReadOnly) // Editable parameters first
.FirstOrDefault();
}

/***************************************************/

[Description("Returns the element parameter that stores the base level of the element. Checks multiple built-in base level parameters in order of preference.")]
[Input("element", "Element to get the base level parameter from.")]
[Output("parameter", "Parameter that stores the base level, or null if not found or parameter is read-only.")]
[Output("parameter", "Base level parameter of the element, or null if not found.")]
public static Parameter BaseLevelParameter(this Element element)
{
if (element == null)
Expand All @@ -63,15 +63,15 @@ public static Parameter BaseLevelParameter(this Element element)
.Select(x => element.get_Parameter(x))
.Where(x => x != null)
.OrderByDescending(x => x.AsElementId().Value() != -1) // Valid ElementIds first
.ThenByDescending(x => x.IsReadOnly)
.ThenBy(x => x.IsReadOnly) // Editable parameters first
.FirstOrDefault();
}

/***************************************************/

[Description("Returns the element parameter that stores the top level of the element. Checks multiple built-in top level parameters in order of preference.")]
[Input("element", "Element to get the top level parameter from.")]
[Output("parameter", "Parameter that stores the top level, or null if not found or parameter is read-only.")]
[Output("parameter", "Top level parameter of the element, or null if not found.")]
public static Parameter TopLevelParameter(this Element element)
{
if (element == null)
Expand All @@ -81,7 +81,7 @@ public static Parameter TopLevelParameter(this Element element)
.Select(x => element.get_Parameter(x))
.Where(x => x != null)
.OrderByDescending(x => x.AsElementId().Value() != -1) // Valid ElementIds first
.ThenByDescending(x => x.IsReadOnly)
.ThenBy(x => x.IsReadOnly) // Editable parameters first
.FirstOrDefault();
}

Expand Down
Loading