count
Counting functions for Revit elements.
Functions
count_unpinned_revit_links(revitlinks_elements)
Returns the number of unpinned Revit links in the document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rvtlinks_elements
|
list
|
A list of Revit link elements. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The number of unpinned Revit links in the document. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_unplaced_rooms(rooms)
Counts the number of unplaced rooms in a given list of rooms. An unplaced room is defined as a room with no location (i.e., room.Location is None).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rooms
|
list
|
A list of room objects. Defaults to None. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The number of unplaced rooms in the list. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_unbounded_rooms(rooms)
Counts the number of unbounded rooms (rooms with an area of 0) in the given list of rooms.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rooms
|
list
|
A list of room objects. Each room object should have an 'Area' attribute. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The number of unbounded rooms in the list. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_analytical_model_activated(document)
Returns the number of activated analytical models in the document.
Args: document (Document): A Revit document.
Returns: int: The number of elements with the analytical model activated in the document.
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_copied_views(views_set)
Returns the number of views in the given set that have "Copy" or "Copie" in their name.
Args: views_set (set): A set of views to check for copied views. Defaults to None.
Returns: int: The number of views in the set that have "Copy" or "Copie" in their name.
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_unused_view_templates(views_list, document)
Returns the count of unused view templates in the given list of views.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
views
|
list
|
A list of views to check for unused view templates. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The count of unused view templates. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_unused_filters_in_views(view_list, filters)
Counts the number of unused filters in the given list of views.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
view_list
|
list
|
A list of Revit view objects to check for filter usage. |
required |
filters
|
list
|
A list of filter objects to check against the views. |
required |
Returns
|
|
required | |
int
|
The number of filters that are not used in any of the provided views. |
required |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_linked_dwg_files(document)
Returns the number of linked DWG files in the document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document
|
Document
|
The Revit document to search for linked DWG files. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The number of linked DWG files in the document. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_in_place_families(document)
This function collects all the in-place families in the given document and returns their count.
Args: - document: The Revit document to search for in-place families in.
Returns: - int: The count of in-place families.
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_total_families(document)
Counts the total number of unique family names in the given Revit document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document
|
The Revit document to count families from. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The total number of unique family names in the document. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_textnote_types_with_changed_width_factor(text_notes_types)
Counts the number of text note types that have a width factor different from the default value of 1.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text_notes_types
|
list
|
A list of text note types to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The number of text note types with a changed width factor. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_textnote_types_with_opaque_background(text_notes_types)
Counts the number of text notes with an opaque background.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text_notes_types
|
list
|
A list of text note elements. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The number of text notes with an opaque background. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_text_notes_with_all_caps(text_notes)
Counts the number of text notes that have all capital letters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text_notes
|
list
|
A list of text note objects. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The number of text notes with all capital letters. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_unnamed_reference_planes(reference_planes)
Returns the count of unnamed reference planes in the given document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document
|
Document
|
The document to search for reference planes. Defaults to the active document. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The count of unnamed reference planes. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_dimension_overrides(dimensions)
Counts the number of dimension overrides in a list of dimensions. This function iterates through a list of dimensions and counts how many of them have a value override. It also checks for overrides in dimension segments if they exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dimensions
|
list
|
A list of dimension objects to check for overrides. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The total count of dimension overrides found in the list of dimensions. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_revision_clouds(document)
Returns the number of revision clouds in the given document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document
|
Document
|
The document to search for revision clouds in. Defaults to the active document. |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
The number of revision clouds in the document. |
Source code in pyrevitlib/pyrevit/revit/db/count.py
count_groups(doc)
Counts the instances and types of model and detail groups in a Revit document, excluding array members.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc
|
Document
|
The Revit document to process. |
required |
Returns:
Name | Type | Description |
---|---|---|
tuple |
A tuple containing four integers: - model_group_instances_count (int): The count of model group instances. - model_group_types_count (int): The count of model group types. - detail_group_instances_count (int): The count of detail group instances. - detail_group_types_count (int): The count of detail group types. |