query
Helper functions to query info and elements from Revit.
Attributes
mlogger = logger.get_logger(__name__)
module-attribute
GRAPHICAL_VIEWTYPES = [DB.ViewType.FloorPlan, DB.ViewType.CeilingPlan, DB.ViewType.Elevation, DB.ViewType.ThreeD, DB.ViewType.Schedule, DB.ViewType.DrawingSheet, DB.ViewType.Report, DB.ViewType.DraftingView, DB.ViewType.Legend, DB.ViewType.EngineeringPlan, DB.ViewType.AreaPlan, DB.ViewType.Section, DB.ViewType.Detail, DB.ViewType.CostReport, DB.ViewType.LoadsReport, DB.ViewType.PresureLossReport, DB.ViewType.ColumnSchedule, DB.ViewType.PanelSchedule, DB.ViewType.Walkthrough, DB.ViewType.Rendering]
module-attribute
DETAIL_CURVES = (DB.DetailLine, DB.DetailArc, DB.DetailEllipse, DB.DetailNurbSpline)
module-attribute
MODEL_CURVES = (DB.ModelLine, DB.ModelArc, DB.ModelEllipse, DB.ModelNurbSpline)
module-attribute
BUILTINCATEGORIES_VIEW = [DB.BuiltInCategory.OST_Views, DB.BuiltInCategory.OST_ReferenceViewer, DB.BuiltInCategory.OST_Viewers]
module-attribute
GridPoint = namedtuple('GridPoint', ['point', 'grids'])
module-attribute
SheetRefInfo = namedtuple('SheetRefInfo', ['sheet_num', 'sheet_name', 'detail_num', 'ref_viewid'])
module-attribute
ElementHistory = namedtuple('ElementHistory', ['creator', 'owner', 'last_changed_by'])
module-attribute
Classes
Functions
get_name(element, title_on_sheet=False)
Retrieves the name of a Revit element, with special handling for views.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element whose name is to be retrieved. |
required |
title_on_sheet
|
bool
|
If True and the element is a view, attempts to retrieve the view's title on the sheet. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
str |
The name of the element. For views, it may return the view's title
on the sheet if |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_type(element)
Get element type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
source element |
required |
Returns:
Type | Description |
---|---|
ElementType
|
type object of given element |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_symbol_name(element)
Retrieves the name of the symbol associated with the given Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
The Revit element from which to retrieve the symbol name. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
The name of the symbol associated with the given element. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_family_name(element)
Retrieves the family name of a given Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
The Revit element from which to get the family name. It is expected to have a 'Symbol' attribute with a 'Family' property. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
The name of the family to which the element belongs. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_episodeid(element)
Extract episode id from the given Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
The Revit element from which to extract the episode id. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
The episode id extracted from the element's UniqueId. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_guid(element)
Generates a GUID for a given Revit element by performing a bitwise XOR operation on parts of the element's UniqueId.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
The Revit element for which the GUID is to be generated. The element must have a UniqueId attribute. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
A string representing the generated GUID. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_param(element, param_name, default=None)
Retrieves a parameter from a Revit element by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element from which to retrieve the parameter. |
required |
param_name
|
str
|
The name of the parameter to retrieve. |
required |
default
|
The value to return if the parameter is not found or an error occurs. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
The parameter if found, otherwise the default value. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_mark(element)
Retrieves the 'Mark' parameter value from a given Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
The Revit element from which to retrieve the 'Mark' parameter. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
The value of the 'Mark' parameter as a string. |
Returns an empty string if the parameter is not found.
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_location(element)
Get element location point.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
source element |
required |
Returns:
Type | Description |
---|---|
XYZ
|
X, Y, Z of location point element |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_biparam_stringequals_filter(bip_paramvalue_dict)
Creates a Revit ElementParameterFilter based on a dictionary of built-in parameter (BIP) values and their corresponding filter values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bip_paramvalue_dict
|
dict
|
A dictionary where keys are built-in parameter (BIP) identifiers and values are the corresponding filter values. |
required |
Returns:
Type | Description |
---|---|
DB.ElementParameterFilter: A filter that can be used to filter Revit elements based on the specified BIP values. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If no filters could be created from the provided dictionary. |
Notes
- The function handles different Revit API versions by checking if the host application is newer than the 2022 version.
- For Revit versions newer than 2022, the
FilterStringRule
does not require thecaseSensitive
parameter.
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_elements(doc=None)
Retrieves all elements from the given Revit document. This function uses a FilteredElementCollector to collect all elements in the provided document, including both element types and instances.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to collect elements from. If not provided, the default document (DOCS.doc) is used. |
None
|
Returns:
Type | Description |
---|---|
List[Element]: A list of all elements in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_elements_in_view(view)
Retrieves all elements in the specified Revit view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
The Revit view from which to collect elements. |
required |
Returns:
Type | Description |
---|---|
list[Autodesk.Revit.DB.Element]: A list of elements present in the specified view. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_param_value(targetparam)
Retrieves the value of a given Revit parameter. Parameters: targetparam (DB.Parameter or DB.GlobalParameter): The parameter whose value is to be retrieved.
value (varies): The value of the parameter. The type of the returned value depends on the storage type of the parameter: - Double: Returns a float. - Integer: Returns an int. - String: Returns a str. - ElementId: Returns an ElementId. If the parameter is a GlobalParameter, returns the value directly from the GlobalParameter.
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_value_range(param_name, doc=None)
Retrieves a set of unique values for a specified parameter from all elements in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name
|
str
|
The name of the parameter to retrieve values for. |
required |
doc
|
Document
|
The Revit document to search within. If None, the current document is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
set |
A set of unique values for the specified parameter. The values can be of any type, but are typically strings. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_elements_by_parameter(param_name, param_value, doc=None, partial=False)
Retrieves elements from the Revit document that match a given parameter name and value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name
|
str
|
The name of the parameter to search for. |
required |
param_value
|
str or other
|
The value of the parameter to match. |
required |
doc
|
Document
|
The Revit document to search in. If None, the current document is used. |
None
|
partial
|
bool
|
If True, performs a partial match on string parameter values. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of elements that match the specified parameter name and value. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_elements_by_param_value(param_name, param_value, inverse=False, doc=None)
Retrieves elements from the Revit document based on a parameter name and value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name
|
str
|
The name of the parameter to filter by. |
required |
param_value
|
str
|
The value of the parameter to filter by. |
required |
inverse
|
bool
|
If True, inverts the filter to exclude elements with the specified parameter value. Defaults to False. |
False
|
doc
|
Document
|
The Revit document to search in. If None, uses the default document. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of elements that match the parameter name and value. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_elements_by_categories(element_bicats, elements=None, doc=None)
Retrieves elements from a Revit document based on specified categories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element_bicats
|
list
|
A list of built-in categories to filter elements by. |
required |
elements
|
list
|
A list of elements to filter. If provided, the function will filter these elements. |
None
|
doc
|
Document
|
The Revit document to collect elements from. If not provided, the active document is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of elements that belong to the specified categories. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_elements_by_class(element_class, elements=None, doc=None, view_id=None)
Retrieves elements of a specified class from a Revit document or a given list of elements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element_class
|
type
|
The class type of the elements to retrieve. |
required |
elements
|
list
|
A list of elements to filter by the specified class. Defaults to None. |
None
|
doc
|
Document
|
The Revit document to search within. Defaults to None. |
None
|
view_id
|
ElementId
|
The ID of the view to restrict the search to. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of elements of the specified class. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_types_by_class(type_class, types=None, doc=None)
Retrieves elements of a specified class type from a given list or from the Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type_class
|
type
|
The class type to filter elements by. |
required |
types
|
list
|
A list of elements to filter. If not provided, elements will be collected from the Revit document. |
None
|
doc
|
Document
|
The Revit document to collect elements from if 'types' is not provided. Defaults to the active document. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of elements that are instances of the specified class type. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_family(family_name, doc=None)
Retrieves all family elements in the Revit document that match the given family name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
family_name
|
str
|
The name of the family to search for. |
required |
doc
|
Document
|
The Revit document to search in. If not provided, the current document is used. |
None
|
Returns:
Type | Description |
---|---|
list[DB.Element]: A list of family elements that match the given family name. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_family_symbol(family_name, symbol_name, doc=None)
Retrieves family symbols from a Revit document based on the specified family name and symbol name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
family_name
|
str
|
The name of the family to search for. |
required |
symbol_name
|
str
|
The name of the symbol within the family to search for. |
required |
doc
|
Document
|
The Revit document to search in. If not provided, the default document is used. |
None
|
Returns:
Type | Description |
---|---|
list[DB.Element]: A list of family symbols that match the specified family name and symbol name. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_families(doc=None, only_editable=True)
Retrieves a list of families from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve families from. If not provided, defaults to DOCS.doc. |
None
|
only_editable
|
bool
|
If True, only returns families that are editable. Defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of Family objects from the document. If only_editable is True, only includes families that are editable. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_noteblock_families(doc=None)
Retrieves a list of noteblock families from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to query. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of noteblock family elements in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_elements_by_family(family_name, doc=None)
Retrieves elements from a Revit document based on the specified family name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
family_name
|
str
|
The name of the family to filter elements by. |
required |
doc
|
Document
|
The Revit document to search within. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Type | Description |
---|---|
list[DB.Element]: A list of elements that belong to the specified family. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_elements_by_familytype(family_name, symbol_name, doc=None)
Retrieves elements from a Revit document based on the specified family and symbol names.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
family_name
|
str
|
The name of the family to filter elements by. |
required |
symbol_name
|
str
|
The name of the symbol (type) to filter elements by. |
required |
doc
|
Document
|
The Revit document to search in. If not provided, the current document is used. |
None
|
Returns:
Type | Description |
---|---|
list[DB.Element]: A list of elements that match the specified family and symbol names. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
find_workset(workset_name_or_list, doc=None, partial=True)
Finds a workset in the given Revit document by name or list of names.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workset_name_or_list
|
str or list
|
The name of the workset to find or a list of workset names. |
required |
doc
|
Document
|
The Revit document to search in. If None, the default document is used. |
None
|
partial
|
bool
|
If True, allows partial matching of workset names. Defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
Workset |
The first matching workset found, or None if no match is found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
model_has_family(family_name, doc=None)
Checks if the Revit model contains a family with the given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
family_name
|
str
|
The name of the family to search for. |
required |
doc
|
Document
|
The Revit document to search in. If None, the current document is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the family is found in the model, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
model_has_workset(workset_name, partial=False, doc=None)
Checks if the model has a workset with the given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workset_name
|
str
|
The name of the workset to search for. |
required |
partial
|
bool
|
If True, allows partial matching of the workset name. Defaults to False. |
False
|
doc
|
Document
|
The Revit document to search within. If None, the current document is used. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the workset is found, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_worksets_names(doc=None)
Returns a string with the names of all user worksets in a document
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document
|
Document
|
A Revit document. de |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
A string with the names of all user worksets in a document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_critical_warnings_count(warnings, critical_warnings_template)
Counts the number of critical warnings from a list of warnings based on a template.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
warnings
|
list
|
A list of warning objects. Each warning object should have a method
|
required |
critical_warnings_template
|
list
|
A list of string representations of GUIDs that are considered critical warnings. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The count of critical warnings. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_sharedparam_definition_file()
Retrieves the shared parameters definition file from the host application.
Returns:
Name | Type | Description |
---|---|---|
SharedParameterFile |
The shared parameters file if it exists and is successfully opened. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If the shared parameters file is not defined or cannot be opened. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_defined_sharedparams()
Retrieves all defined shared parameters from the shared parameter file.
Returns:
Name | Type | Description |
---|---|---|
list |
A list of DB.ExternalDefinition objects representing the shared parameters. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If there is an error accessing the shared parameter file. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_project_parameters(doc=None)
Retrieves the project parameters from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document from which to retrieve the project parameters.
If not provided, defaults to |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of ProjectParameter objects representing the project parameters in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_project_parameter_id(param_name, doc=None)
Retrieves the ID of a project parameter by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name
|
str
|
The name of the project parameter to find. |
required |
doc
|
Document
|
The Revit document to search in. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
ElementId |
The ID of the project parameter. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If the parameter with the specified name is not found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_project_parameter(param_id_or_name, doc=None)
Retrieves a project parameter by its ID or name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_id_or_name
|
str or int
|
The ID or name of the project parameter to retrieve. |
required |
doc
|
Document
|
The Revit document to search in. If not provided, the default document is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
ProjectParameter |
The matching project parameter if found, otherwise None. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
model_has_parameter(param_id_or_name, doc=None)
Checks if the model has a specific parameter by its ID or name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_id_or_name
|
str or int
|
The parameter ID or name to check for. |
required |
doc
|
Document
|
The Revit document to search in. If None, the current document is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the parameter exists in the model, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_global_parameters(doc=None)
Retrieves all global parameters from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document from which to retrieve global parameters. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of global parameter elements in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_global_parameter(param_name, doc=None)
Retrieves a global parameter by its name from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name
|
str
|
The name of the global parameter to retrieve. |
required |
doc
|
Document
|
The Revit document to search in. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Type | Description |
---|---|
DB.GlobalParameter: The global parameter element if found, otherwise None. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_project_info(doc=None)
Retrieves the project information from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document from which to retrieve the project information. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
ProjectInfo |
The project information of the specified or default Revit document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_phases_names(doc=None)
Returns a comma-separated list of the names of the phases in a project.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document
|
Document
|
A Revit document. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
A comma-separated list of the names of the phases in a project. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_revisions(doc=None)
Retrieves a list of revision elements from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve revisions from. If not provided, the default document (DOCS.doc) is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of revision elements in the specified Revit document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_sheet_revisions(sheet)
Retrieves the revisions associated with a given Revit sheet.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sheet
|
ViewSheet
|
The Revit sheet from which to retrieve revisions. |
required |
Returns:
Type | Description |
---|---|
list[Autodesk.Revit.DB.Element]: A list of revision elements associated with the sheet. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_current_sheet_revision(sheet)
Retrieves the current revision of the given sheet.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sheet
|
ViewSheet
|
The sheet for which to get the current revision. |
required |
Returns:
Type | Description |
---|---|
Autodesk.Revit.DB.Element: The current revision element of the sheet. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_sheets(include_placeholders=True, include_noappear=True, doc=None)
Retrieves a list of sheets from the Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
include_placeholders
|
bool
|
If True, includes placeholder sheets in the result. Defaults to True. |
True
|
include_noappear
|
bool
|
If True, includes sheets that do not appear in the project browser. Defaults to True. |
True
|
doc
|
Document
|
The Revit document to retrieve sheets from. If None, uses the current document. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of sheets from the specified Revit document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_document_clean_name(doc=None)
Return the name of the given document without the file path or file extension.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve links from. If None, the default document (DOCS.doc) is used. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
The name of the given document without the file path or file |
|
extension. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_links(linktype=None, doc=None)
Retrieves external file references (links) from a Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
linktype
|
ExternalFileReferenceType
|
The type of external file reference to filter by. If None, all external file references are returned. Defaults to None. |
None
|
doc
|
Document
|
The Revit document to retrieve links from. If None, the default document (DOCS.doc) is used. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of db.ExternalRef objects representing the external file references in the document. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If the document is not saved or if there is an error reading the links from the model path. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_linked_models(doc=None, loaded_only=False)
Retrieves the linked Revit models in the given document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search for linked models. If None, defaults to DOCS.doc. |
None
|
loaded_only
|
bool
|
If True, only returns the linked models that are currently loaded. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of linked Revit models. If loaded_only is True, only the loaded models are returned. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_linked_model_doc(linked_model)
Retrieves the document of a linked Revit model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
linked_model
|
Union[RevitLinkType, ExternalRef]
|
The linked model, which can be either a RevitLinkType or an ExternalRef. |
required |
Returns:
Name | Type | Description |
---|---|---|
Document |
The document of the linked model if found, otherwise None. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_linked_model_types(doc, rvt_links_instances)
Retrieves the types of linked Revit models. Args: doc (Document): The Revit document. Defaults to None. rvt_links_instances (list): A list of Revit link instances. Returns: list: A list of linked model types.
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_linked_model_instances(doc=None)
Returns a list of all rvt_links instances in a document
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
A Revit document. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of Revit link instances. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_rvt_link_status(doc=None)
Retrieves the status of linked Revit models in the given document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to query. If None, the current document is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of statuses for each linked Revit model type. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_rvt_link_doc_name(rvtlink_instance)
Retrieves the name of the Revit link document from the given Revit link instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rvtlink_instance
|
The Revit link instance from which to extract the document name. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
The name of the Revit link document, without the file extension and any directory paths. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_rvt_link_instance_name(rvtlink_instance=None)
Retrieves the name of a Revit link instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rvtlink_instance
|
The Revit link instance object. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
The name of the Revit link instance, extracted from the full name. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
find_first_legend(doc=None)
Finds the first legend view in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search in. If not provided, it defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
View |
The first legend view found in the document, or None if no legend view is found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
compare_revisions(src_rev, dest_rev, case_sensitive=False)
Compare two revision objects based on specific attributes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src_rev
|
object
|
The source revision object to compare. |
required |
dest_rev
|
object
|
The destination revision object to compare. |
required |
case_sensitive
|
bool
|
Flag to indicate if the comparison should be case sensitive. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if all specified attributes match between the two revisions, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_views(doc=None, view_types=None, include_nongraphical=False)
Retrieves all views from the given Revit document, with optional filtering by view types and graphical views.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve views from. If None, defaults to DOCS.doc. |
None
|
view_types
|
list
|
A list of view types to filter the views. If None, no filtering is applied. |
None
|
include_nongraphical
|
bool
|
If True, includes non-graphical views in the result. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of views from the Revit document, filtered by the specified criteria. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_view_templates(doc=None, view_types=None)
Retrieves all view templates from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search for view templates. If None, the active document will be used. |
None
|
view_types
|
list
|
A list of view types to filter the views. If None, all view types will be considered. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of view templates found in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_sheet_by_number(sheet_num, doc=None)
Retrieves a sheet from the document by its sheet number.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sheet_num
|
str
|
The sheet number to search for. |
required |
doc
|
Document
|
The Revit document to search within. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Element |
The sheet element with the specified sheet number, or None if no matching sheet is found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_viewport_by_number(sheet_num, detail_num, doc=None)
Retrieves a viewport from a Revit document based on the sheet number and detail number.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sheet_num
|
str
|
The number of the sheet containing the viewport. |
required |
detail_num
|
str
|
The detail number of the viewport to retrieve. |
required |
doc
|
Document
|
The Revit document to search in. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Element |
The viewport element if found, otherwise None. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_view_by_sheetref(sheet_num, detail_num, doc=None)
Retrieves the view ID associated with a given sheet number and detail number.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sheet_num
|
int
|
The sheet number to search for. |
required |
detail_num
|
int
|
The detail number to search for. |
required |
doc
|
Document
|
The Revit document to search within. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
ElementId |
The ID of the view associated with the specified sheet and detail numbers, or None if not found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_schedule(view)
Determines if the given view is a schedule that is not a template, title block revision schedule, internal keynote schedule, or keynote legend.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
The Revit view to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the view is a schedule and not one of the excluded types, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_schedules(doc=None)
Retrieves all schedule views from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve schedules from. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
filter |
A filter object containing all schedule views in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_view_by_name(view_name, view_types=None, doc=None)
Retrieves a Revit view by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view_name
|
str
|
The name of the view to retrieve. |
required |
view_types
|
list
|
A list of view types to filter the search. Defaults to None. |
None
|
doc
|
Document
|
The Revit document to search within. Defaults to the active document. |
None
|
Returns:
Name | Type | Description |
---|---|---|
View |
The Revit view that matches the given name, or None if no match is found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_referencing_elements(doc=None)
Retrieves all elements in the given Revit document that reference views. This function collects all elements in the provided Revit document that are not element types, belong to a category, are instances of DB.Element, and whose category is in the predefined set of view-related built-in categories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search for referencing elements. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Type | Description |
---|---|
list[DB.ElementId]: A list of element IDs that reference views in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_referencing_elements_in_view(view)
Retrieves all elements in the given view that reference other elements.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
The Revit view from which to collect referencing elements. |
required |
Returns:
Type | Description |
---|---|
list[DB.ElementId]: A list of element IDs that reference other elements in the view. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_schedules_on_sheet(viewsheet, doc=None)
Retrieves all schedule instances placed on a given Revit view sheet.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
viewsheet
|
ViewSheet
|
The Revit view sheet from which to retrieve schedule instances. |
required |
doc
|
Document
|
The Revit document. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of schedule instances (DB.ScheduleSheetInstance) that are placed on the given view sheet, excluding title block revision schedules. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_schedules_instances(doc=None)
Retrieves all schedule instances placed on sheets.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search within. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Type | Description |
---|---|
List[ScheduleSheetInstance]: A list of ScheduleSheetInstance elements. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_sheet_empty(viewsheet)
Checks if a given Revit sheet is empty.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
viewsheet
|
The Revit sheet to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the sheet has no viewports or schedules, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_doc_categories(doc=None, include_subcats=True)
Retrieves all categories from the given Revit document, optionally including subcategories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document from which to retrieve categories. If not provided, defaults to DOCS.doc. |
None
|
include_subcats
|
bool
|
Whether to include subcategories in the result. Defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of all categories (and subcategories, if include_subcats is True) in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_schedule_categories(doc=None)
Retrieves the categories that are valid for schedules in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve the schedule categories from. If not provided, it defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of categories that are valid for schedules in the given Revit document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_key_schedule_categories(doc=None)
Retrieves the categories that are valid for key schedules in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve categories from. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of categories that are valid for key schedules. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_takeoff_categories(doc=None)
Retrieves the categories that are valid for material takeoff schedules in a given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve categories from. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of categories that are valid for material takeoff schedules. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_category(cat_name_or_builtin, doc=None)
Retrieves a Revit category based on the provided category name, built-in category, or category object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cat_name_or_builtin
|
Union[str, BuiltInCategory, Category]
|
The category name as a string, a built-in category enum, or a category object. |
required |
doc
|
Optional[Document]
|
The Revit document to search within. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Type | Description |
---|---|
DB.Category: The matching Revit category object, or None if no match is found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_builtincategory(cat_name_or_id, doc=None)
Retrieves the BuiltInCategory for a given category name or ElementId.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cat_name_or_id
|
str or ElementId
|
The name of the category as a string or the ElementId of the category. |
required |
doc
|
optional
|
The Revit document. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Type | Description |
---|---|
DB.BuiltInCategory: The corresponding BuiltInCategory if found, otherwise None. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_subcategories(doc=None, purgable=False, filterfunc=None)
Retrieves subcategories from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve subcategories from. If None, defaults to DOCS.doc. |
None
|
purgable
|
bool
|
If True, only includes subcategories that are purgable (element ID value greater than 1). Defaults to False. |
False
|
filterfunc
|
function
|
A function to filter the subcategories. If provided, only subcategories that satisfy the filter function will be included. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of subcategories from the given Revit document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_subcategory(cat_name_or_builtin, subcategory_name, doc=None)
Retrieves a subcategory from a given category in a Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cat_name_or_builtin
|
str or BuiltInCategory
|
The name of the category or a built-in category. |
required |
subcategory_name
|
str
|
The name of the subcategory to retrieve. |
required |
doc
|
Document
|
The Revit document to search in. Defaults to the active document. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Category |
The subcategory if found, otherwise None. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_builtinparameter(element, param_name, doc=None)
Retrieves the built-in parameter associated with a given element and parameter name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element from which to retrieve the parameter. |
required |
param_name
|
str
|
The name of the parameter to look up. |
required |
doc
|
Document
|
The Revit document. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
BuiltInParameter |
The built-in parameter corresponding to the given element and parameter name. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If the parameter with the given name is not found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_view_cutplane_offset(view)
Retrieves the offset of the cut plane for a given Revit view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
The Revit view from which to get the cut plane offset. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
The offset of the cut plane in the view. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_project_location_transform(doc=None)
Retrieves the transformation matrix of the active project location in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document from which to get the project location transform. If not provided, it defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Transform |
The transformation matrix of the active project location. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_linkedmodels(doc=None)
Retrieves all linked Revit models in the given document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search for linked models. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Type | Description |
---|---|
List[Element]: A list of RevitLinkType elements representing the linked models. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_linkeddocs(doc=None)
Retrieves all linked documents in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search for linked documents. If None, it defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of linked Revit documents. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_grids(group_by_direction=False, include_linked_models=False, doc=None)
Retrieves all grid elements from the given Revit document and optionally from linked models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group_by_direction
|
bool
|
If True, groups the grids by their direction. |
False
|
include_linked_models
|
bool
|
If True, includes grids from linked models. |
False
|
doc
|
Document
|
The Revit document to retrieve grids from. If None, uses the current document. |
None
|
Returns:
Type | Description |
---|---|
list or dict: A list of all grid elements if group_by_direction is False. A dictionary grouping grid elements by their direction if group_by_direction is True. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_gridpoints(grids=None, include_linked_models=False, doc=None)
Retrieves the intersection points of grid lines in a Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
grids
|
list
|
A list of grid elements to consider. If None, all grids in the document are considered. |
None
|
include_linked_models
|
bool
|
If True, includes grids from linked models. Defaults to False. |
False
|
doc
|
Document
|
The Revit document to operate on. If None, uses the current active document. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of GridPoint objects representing the intersection points of the grid lines. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_closest_gridpoint(element, gridpoints)
Finds the closest grid point to a given element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
The element for which the closest grid point is to be found. It is expected to have a Location attribute with a Point property. |
required | |
gridpoints
|
A list of grid points. Each grid point is expected to have a point attribute with an unwrap() method that returns an object with a DistanceTo method. |
required |
Returns:
Type | Description |
---|---|
The grid point that is closest to the given element. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_category_set(category_list, doc=None)
Creates a CategorySet from a list of built-in categories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
category_list
|
list
|
A list of built-in categories to include in the CategorySet. |
required |
doc
|
Document
|
The Revit document to use. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
CategorySet |
A set of categories created from the provided list. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_category_set(bindable=True, doc=None)
Retrieves a set of all categories in the Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bindable
|
bool
|
If True, only includes categories that allow bound parameters. Defaults to True. |
True
|
doc
|
Document
|
The Revit document to retrieve categories from. If None, uses the default document. |
None
|
Returns:
Name | Type | Description |
---|---|---|
CategorySet |
A set of categories from the specified Revit document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_rule_filters(doc=None)
Retrieves a list of rule-based filters from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve the filters from. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of ParameterFilterElement instances from the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_connected_circuits(element, spare=False, space=False)
Retrieves the electrical circuits connected to a given element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element to get connected circuits for. |
required |
spare
|
bool
|
Include spare circuits if True. Defaults to False. |
False
|
space
|
bool
|
Include space circuits if True. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of electrical systems connected to the element that match the specified circuit types. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_element_categories(elements)
Given a list of Revit elements, returns a list of unique categories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
elements
|
list
|
A list of Revit elements. |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
A list of unique categories of the given elements. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_category_schedules(category_or_catname, doc=None)
Retrieves all schedules for a given category in a Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
category_or_catname
|
str or Category
|
The category or category name to filter schedules. |
required |
doc
|
Document
|
The Revit document to search in. Defaults to None, in which case the default document is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of schedules that belong to the specified category. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_schedule_field(schedule, field_name)
Retrieves a specific field from a Revit schedule by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedule
|
Schedule
|
The Revit schedule object. |
required |
field_name
|
str
|
The name of the field to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
ScheduleField |
The field object if found, otherwise None. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_schedule_filters(schedule, field_name, return_index=False)
Retrieves the filters applied to a schedule based on a specified field name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedule
|
Schedule
|
The schedule from which to retrieve filters. |
required |
field_name
|
str
|
The name of the field to match filters against. |
required |
return_index
|
bool
|
If True, returns the indices of the matching filters. If False, returns the filter objects. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of matching filters or their indices, depending on the value of return_index. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_sheet_tblocks(src_sheet)
Retrieves all title block elements from a given Revit sheet.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src_sheet
|
ViewSheet
|
The source Revit sheet from which to collect title blocks. |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
A list of title block elements present on the specified sheet. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_sheet_sets(doc=None)
Retrieves all sheet sets from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve sheet sets from. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of ViewSheetSet elements from the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_rev_number(revision, sheet=None)
Get the revision number for a given revision. If a sheet is provided and it is an instance of DB.ViewSheet, the function returns the revision number as it appears on the sheet. Otherwise, it returns the sequence number of the revision or the revision number if it exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
revision
|
Revision
|
The revision object to get the number for. |
required |
sheet
|
ViewSheet
|
The sheet object to get the revision number from. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
The revision number as a string. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_pointclouds(doc=None)
Retrieves all point cloud elements from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search for point cloud elements. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of point cloud elements found in the specified document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_mep_connections(element)
Retrieves the MEP (Mechanical, Electrical, and Plumbing) connections for a given Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element for which to retrieve MEP connections. This can be a FamilyInstance or a Plumbing Pipe. |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
A list of elements that are connected to the given element through MEP connections. |
Returns an empty list if no connections are found or if the element does not have a ConnectorManager.
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_fillpattern_element(fillpattern_name, fillpattern_target, doc=None)
Retrieves a FillPatternElement from the Revit document based on the given fill pattern name and target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fillpattern_name
|
str
|
The name of the fill pattern to search for. |
required |
fillpattern_target
|
FillPatternTarget
|
The target type of the fill pattern (e.g., Drafting or Model). |
required |
doc
|
Document
|
The Revit document to search in. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Type | Description |
---|---|
DB.FillPatternElement: The FillPatternElement that matches the given name and target, or None if not found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_fillpattern_elements(fillpattern_target, doc=None)
Retrieves all fill pattern elements from the given document that match the specified fill pattern target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fillpattern_target
|
FillPatternTarget
|
The target fill pattern to match. |
required |
doc
|
Document
|
The Revit document to search within. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of fill pattern elements that match the specified fill pattern target. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_fillpattern_from_element(element, background=True, doc=None)
Retrieves the fill pattern from a given Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element from which to retrieve the fill pattern. |
required |
background
|
bool
|
If True, retrieves the background fill pattern; otherwise, retrieves the foreground fill pattern. Defaults to True. |
True
|
doc
|
Document
|
The Revit document. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Type | Description |
---|---|
DB.FillPattern: The fill pattern of the specified element, or None if not found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_local_keynote_file(doc=None)
Retrieves the path to the local keynote file for the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document. If not provided, the default document (DOCS.doc) is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
The user-visible path to the local keynote file if it is an external file reference, otherwise None. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_external_keynote_file(doc=None)
Retrieves the path to the external keynote file associated with the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to query. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
The in-session path to the external keynote file if it exists and has a valid display path, otherwise None. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_keynote_file(doc=None)
Retrieves the keynote file path for the given Revit document. If a local keynote file is available, it returns the local path. Otherwise, it returns the external keynote file path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document. If not provided, the default document (DOCS.doc) is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
The path to the keynote file. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_used_keynotes(doc=None)
Retrieves all keynote tags used in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search for keynote tags. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Type | Description |
---|---|
List[Element]: A list of keynote tag elements found in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_visible_keynotes(view=None)
Retrieves all visible keynote tags in the specified Revit view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
The Revit view from which to retrieve keynote tags. |
None
|
Returns:
Type | Description |
---|---|
list[Autodesk.Revit.DB.Element]: A list of keynote tag elements visible in the specified view. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_available_keynotes(doc=None)
Retrieves the available keynotes from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document from which to retrieve keynotes. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Type | Description |
---|---|
DB.KeyBasedTreeEntries: A collection of keynote entries from the keynote table. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_available_keynotes_tree(doc=None)
Retrieves the available keynotes in a hierarchical tree structure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve keynotes from. If not provided, defaults to the current document. |
None
|
Returns:
Name | Type | Description |
---|---|---|
dict |
A dictionary representing the hierarchical structure of keynotes. |
Raises:
Type | Description |
---|---|
NotImplementedError
|
This function is not yet implemented. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_placed(spatial_element)
Check if a spatial element (Room, Area, or Space) is placed and has a positive area.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spatial_element
|
Element
|
The spatial element to check. It can be an instance of DB.Architecture.Room, DB.Area, or DB.Mechanical.Space. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the spatial element is placed and has an area greater than 0, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_central_path(doc=None)
Returns the central model path of a Revit document if it is workshared.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
str |
The user-visible path to the central model if the document is workshared. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_metric(doc=None)
Determines if the given Revit document uses the metric unit system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to check. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the document uses the metric unit system, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_imperial(doc=None)
Checks if the given Revit document uses the imperial unit system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to check. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the document uses the imperial unit system, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_view_sheetrefinfo(view)
Retrieves sheet reference information for a given view. This function checks if the view is placed on a sheet by looking at the 'Sheet Number' and 'Sheet Name' parameters. If the view is placed on a sheet, it returns the sheet number, sheet name, and detail number. If the view is not placed on a sheet, it checks the 'Referencing Sheet' and 'Referencing Detail' parameters to see if the view is referenced by another view on a sheet, and returns the corresponding information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
The Revit view object to retrieve sheet reference information from. |
required |
Returns:
Name | Type | Description |
---|---|---|
SheetRefInfo |
An object containing the sheet number, sheet name, detail number, and reference view ID if applicable. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_sheeted_views(doc=None, sheets=None)
Retrieves all view IDs that are placed on sheets in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to query. If not provided, defaults to DOCS.doc. |
None
|
sheets
|
list
|
A list of sheet elements to query. If not provided, defaults to all sheets in the document. |
None
|
Returns:
Name | Type | Description |
---|---|---|
set |
A set of view IDs that are placed on the provided sheets. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_view_sheeted(view)
Checks if a given view is placed on a sheet.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
The Revit view to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the view is placed on a sheet, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
can_refer_other_views(source_view)
Determines if the given source view can refer to other views.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_view
|
The view to check. Expected to be an instance of a Revit view class. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the source view is an instance of DB.ViewDrafting, DB.ViewPlan, or DB.ViewSection; otherwise, False. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_referring_to(source_view, target_view)
Determines if the source view is referring to the target view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_view
|
View
|
The view that may be referring to another view. |
required |
target_view
|
View
|
The view that is being checked if it is referred to by the source view. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the source view is referring to the target view, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
yield_referring_views(target_view, all_views=None)
Yields the IDs of views that refer to the target view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_view
|
View
|
The view that other views may refer to. |
required |
all_views
|
list[View]
|
A list of all views to check. If not provided, all views in the document of the target view will be used. |
None
|
Yields: ElementId: The ID of a view that refers to the target view.
Source code in pyrevitlib/pyrevit/revit/db/query.py
yield_referenced_views(doc=None, all_views=None)
Yields the IDs of views that have referring views.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to query. Defaults to None, in which case the global DOCS.doc is used. |
None
|
all_views
|
list
|
A list of all views in the document. Defaults to None, in which case all views are retrieved using get_all_views(doc). |
None
|
Yields: ElementId: The ID of a view that has referring views.
Source code in pyrevitlib/pyrevit/revit/db/query.py
yield_unreferenced_views(doc=None, all_views=None)
Yields the IDs of views in a Revit document that have no referring views.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to search for unreferenced views. If not provided, defaults to DOCS.doc. |
None
|
all_views
|
list
|
A list of all views in the document. If not provided, it will be retrieved using get_all_views(doc). |
None
|
Yields: ElementId: The ID of each view that has no referring views.
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_line_categories(doc=None)
Retrieves the line categories from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve the line categories from. If not provided, it defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
SubCategories |
The subcategories of the line category in the Revit document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_line_styles(doc=None)
Retrieves the line styles from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to retrieve line styles from. If None, the current document will be used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of GraphicsStyle objects representing the line styles in the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_history(target_element)
Retrieves the worksharing history of a given Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_element
|
Element
|
The Revit element for which to retrieve the history. |
required |
Returns:
Name | Type | Description |
---|---|---|
ElementHistory |
An object containing the creator, owner, and last changed by information of the element. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_detail_curve(element)
Check if the given element is a detail curve.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
The element to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the element is a detail curve, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_model_curve(element)
Check if the given element is a model curve.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
The element to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the element is a model curve, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_sketch_curve(element)
Determines if the given Revit element is a sketch curve.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the element is a sketch curve, False otherwise. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_schemas()
Retrieves all the schemas from the Extensible Storage in Revit.
Returns:
Type | Description |
---|---|
IList[Schema]: A list of all schemas available in the Extensible Storage. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_schema_field_values(element, schema)
Retrieves the values of fields from a given schema for a specified Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element from which to retrieve the schema field values. |
required |
schema
|
Schema
|
The schema that defines the fields to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
A dictionary where the keys are field names and the values are the corresponding field values. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_family_type(type_name, family_doc)
Retrieves a family type from a Revit family document by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type_name
|
str
|
The name of the family type to retrieve. |
required |
family_doc
|
Document
|
The Revit family document to search in. If None, the default document (DOCS.doc) is used. |
required |
Returns:
Name | Type | Description |
---|---|---|
FamilyType |
The family type with the specified name. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If the provided document is not a family document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_family_parameter(param_name, family_doc)
Retrieves a family parameter from a Revit family document by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_name
|
str
|
The name of the parameter to retrieve. |
required |
family_doc
|
Document
|
The Revit family document to search in. If None, defaults to DOCS.doc. |
required |
Returns:
Name | Type | Description |
---|---|---|
FamilyParameter |
The family parameter with the specified name. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If the provided document is not a family document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_family_parameters(family_doc)
Retrieves the parameters of a Revit family document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
family_doc
|
The Revit family document from which to retrieve parameters. If None, the default document (DOCS.doc) will be used. |
required |
Returns:
Type | Description |
---|---|
A collection of family parameters from the specified family document. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If the provided document is not a family document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_family_label_parameters(family_doc)
Retrieves the set of family label parameters from a given Revit family document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
family_doc
|
Document
|
The Revit family document to retrieve label parameters from. If None, the default document (DOCS.doc) is used. |
required |
Returns:
Name | Type | Description |
---|---|---|
set |
A set of family label parameters (DB.FamilyParameter) found in the document. |
Raises:
Type | Description |
---|---|
PyRevitException
|
If the provided document is not a family document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_door_rooms(door)
Get from/to rooms associated with given door element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
door
|
FamilyInstance
|
door instance |
required |
Returns:
Name | Type | Description |
---|---|---|
tuple |
(Room, Room)
|
from/to rooms |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_doors(elements=None, doc=None, room_id=None)
Get all doors in active or given document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
elements
|
list[Element]
|
find rooms in given elements instead |
None
|
doc
|
Document
|
target document; default is active document |
None
|
room_id
|
ElementId
|
only doors associated with given room |
None
|
Returns:
Type | Description |
---|---|
list[Element]
|
room instances |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_all_print_settings(doc=None)
Retrieves all print settings from the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document from which to retrieve print settings. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of print settings elements from the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_used_paper_sizes(doc=None)
Retrieves a list of used paper sizes from the print settings in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to query. If not provided, defaults to DOCS.doc. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of paper sizes used in the print settings of the document. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
find_paper_size_by_name(paper_size_name, doc=None)
Finds and returns a paper size object by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
paper_size_name
|
str
|
The name of the paper size to find. |
required |
doc
|
Document
|
The Revit document to search in. If not provided, the default document (DOCS.doc) will be used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
PaperSize |
The paper size object that matches the given name, or None if not found. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
find_paper_sizes_by_dims(printer_name, paper_width, paper_height, doc=None)
Finds paper sizes by dimensions for a given printer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
printer_name
|
str
|
The name of the printer. |
required |
paper_width
|
float
|
The width of the paper in inches. |
required |
paper_height
|
float
|
The height of the paper in inches. |
required |
doc
|
optional
|
The document context. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of matching paper sizes. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_titleblock_print_settings(tblock, printer_name, doc_psettings)
Retrieves the print settings for a given title block that match the specified printer and document print settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tblock
|
FamilyInstance
|
The title block instance. |
required |
printer_name
|
str
|
The name of the printer. |
required |
doc_psettings
|
list[PrintSetting]
|
A list of document print settings. |
required |
Returns:
Type | Description |
---|---|
list[DB.PrintSetting]: A sorted list of print settings that match the title block size and orientation. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_crop_region(view)
Takes crop region of a view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
view to get crop region from |
required |
Returns:
Type | Description |
---|---|
list[CurveLoop]
|
list of curve loops |
Source code in pyrevitlib/pyrevit/revit/db/query.py
is_cropable_view(view)
Determines if a given Revit view can be cropped.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
The Revit view to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the view can be cropped, False otherwise. |
Notes
A view is considered cropable if it is not an instance of DB.ViewSheet or DB.TableView, and its ViewType is not Legend or DraftingView.
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_view_filters(view)
Retrieves the filters applied to a given Revit view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view
|
View
|
The Revit view from which to retrieve the filters. |
required |
Returns:
Type | Description |
---|---|
list[Autodesk.Revit.DB.Element]: A list of filter elements applied to the view. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_element_workset(element)
Retrieves the workset of a given Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element for which to retrieve the workset. |
required |
Returns:
Type | Description |
---|---|
DB.Workset: The workset to which the element belongs, or None if the element's workset ID is invalid. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_geometry(element, include_invisible=False, compute_references=False)
Retrieves the geometry of a given Revit element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element
|
Element
|
The Revit element from which to retrieve geometry. |
required |
include_invisible
|
bool
|
If True, includes non-visible objects in the geometry. Defaults to False. |
False
|
compute_references
|
bool
|
If True, computes references for the geometry objects. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
list |
A list of geometry objects associated with the element. If the element has no geometry, returns None. |
Raises:
Type | Description |
---|---|
TypeError
|
If the element's geometry cannot be retrieved. |
Notes
- If the geometry object is an instance of DB.GeometryInstance, its instance geometry is retrieved and added to the list.
- Logs a debug message if the element has no geometry.
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_array_group_ids(doc=None)
Collects and returns the IDs of all array groups in the given document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document
|
Document
|
The Revit document to search for array groups. |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
A list of element IDs representing the array groups. |
Source code in pyrevitlib/pyrevit/revit/db/query.py
get_array_group_ids_types(doc=None)
Retrieves the unique types of array groups in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
The Revit document from which to collect array group types. |
None
|
Returns:
Type | Description |
---|---|
A set of unique array group type IDs present in the document. |