BQL: category, parameter and level

category, parameter and level are the most commonly used predicates in BQL. Try the following rules and templates that contain these three predicates.

  • (template) Elements of category with parameter
  • (template) Elements of category on specific level
  • (rule) Worksets containing furniture
  • (rule) Unplaced rooms
  • (rule) Un-used families
  • (rule) Category Inspector
  • (rule) Parameter Inspector
  • (rule) Level Inspector

category(ElementID, CategoryName)

The category of the element with ElementID is  CategoryName.

ElementID is a Revit element ID. CategoryType is a string, e.g. “Walls”, “Beams”.

% finds all elements that are walls
category(ElementID, 'Walls')?

% finds the category name for element @4323123 
category(@4323123, CategoryName)? 

    parameter(ElementID, ParameterName, ParameterValue)

    The parameter predicate extracts parameter values for elements. 

    ElementID is a Revit element ID. ParameterName is a string, e.g. "Fire rating", "Text Style". ParameterValue can be any type.  

    You can inspect parameters by using our Parameter Inspector rule, or check the fields in Revit Properties menu when an element is selected. 

    % Finds all elements with a Fire Rating of one hour.
    parameter(ElementID, ‘Fire Rating’, ‘1 hour’)?

    level(ElementID, LevelName)

    level relates elements to levels, and can be used to find the level of an element, or vice versa.

    ElementID is a Revit element ID. LevelName is a string.

    % Finds all elements on Entry Level.
    level(ElementID, '01 - Entry Level')?


    Want to learn more? You can always search the predicate name in the search bar to get all relevant rules.

    Ye Wang