Sample Code Revit Batch Processor 1.1.14 documentation
get_unique_nested_families_from_path_data()
get_unique_root_families_from_family_data()
get_missing_families()
process_families()
check_families_missing_from_library()
get_direct_root_families()
find_missing_families_direct_host_families()
root_family
nested_family
read_overall_family_data_list()
read_overall_family_data_list_from_directory()
read_overall_family_data_list_into_nested()
read_overall_family_data_list_into_nested_from_directory()
cull_nested_base_data_blocks()
get_nested_family_data_for_root_family()
find_root_families_not_in_nested_data()
find_direct_host_families()
find_all_direct_host_families()
find_root_families_from_hosts()
change_family_category
change_family_sub_category
graphic_property_rgb
graphic_property_line_weight
graphic_property_material
graphic_property_three_d_cut_projection
sub_category_properties_container
sub_category
root_family
nested_family
EXCEPTION_EMPTY_FAMILY_SUBCATEGORY_DATA_FILES
read_overall_family_data_list()
read_overall_family_category_data_from_directory()
read_overall_change_category_directives_list()
read_overall_family_category_change_directives_from_directory()
read_overall_family_sub_category_change_directives_from_directory()
read_overall_change_sub_category_directives_list()
get_families_requiring_sub_category_change()
convert_data_rows_to_data_storage()
read_data_from_file_into_storage()
read_family_base_data()
read_family_category_base_data()
read_family_line_pattern_base_data()
read_family_shared_parameter_data()
read_family_warnings_data()
read_data_into_family_containers()
read_data_into_families()
get_families_from_directory()
get_xml_files_from_directory()
check_file_item_exists()
get_families_requiring_update()
write_data_to_xml_file()
create_xml_file()
write_data_to_temp_xml_file_and_read_it_back()
write_data_to_xml_file_and_read_it_back()
create_family_xml_files()
Filters all generic forms (3D extrusions) in family. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A collector of Autodesk.Revit.DB.GenericForm. :rtype: Autodesk.Revit.DB.FilteredElementCollector
Filters all curve-based elements in a family, including symbolic lines and model lines.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A list of Autodesk.Revit.DB.CurveElement.
list of Autodesk.Revit.DB.CurveElement
Filters all model text elements in family. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A collector of Autodesk.Revit.DB.ModelText. :rtype: Autodesk.Revit.DB.FilteredElementCollector
Filters all reference planes in family. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A collector of Autodesk.Revit.DB.ReferencePlane. :rtype: Autodesk.Revit.DB.FilteredElementCollector
Create a dictionary of family name and the Family element :param rvt_doc: Revit document :type rvt_doc: Autodesk.Revit.DB.Document :return: Dictionary of family name and Family element :rtype: dict
Create a dictionary of family name and category concatenated and the Family element.
The category is concatenated with the family name using the NESTING_SEPARATOR.
This is useful when there are multiple families with the same name but different categories.
rvt_doc (Autodesk.Revit.DB.Document) – Revit document
Dictionary of family name and category and Family element
dict
Get all the symbol names of a family
family (Autodesk.Revit.DB.Family) – Family element
List of symbol names of the family
list
Returns a bounding box of the family instance based on solids in the family instance geometry only.
doc (Autodesk.Revit.DB.Document) – The revit document.
family_instance (Autodesk.Revit.DB.FamilyInstance) – The family instance to get the bounding box from.
The bounding box of the family instance or None if no solids within the family instance are found.
Autodesk.Revit.DB.BoundingBoxXYZ or None
Places a family instance by level.
Note: It is much faster to modify the family instance after placement in the same transaction than to place it in one transaction and modify its parameters in a separate transaction. Use the modify_action parameter to provide a function that modifies the family instance after placement. Function to accept a family instance as a parameter.
doc (Autodesk.Revit.DB.Document) – The revit document.
location_point (Autodesk.Revit.DB.XYZ) – The location point of the family instance.
family_symbol (Autodesk.Revit.DB.FamilySymbol) – The family symbol to place.
target_placement_level (Autodesk.Revit.DB.Level) – The level to place the family instance on.
transaction_manager (function) – The transaction manager to use.
modify_action (function) – An action to run after the family instance is placed to modify its properties.
A result object.
Places a family instance in a basic wall.
Note: It is much faster to modify the family instance after placement in the same transaction than to place it in one transaction and modify its parameters in a separate transaction. Use the modify_action parameter to provide a function that modifies the family instance after placement. Function to accept a family instance as a parameter.
doc (Autodesk.Revit.DB.Document) – The revit document.
location_point (Autodesk.Revit.DB.XYZ) – The location point of the family instance.
wall (Autodesk.Revit.DB.Wall) – The wall to place the family instance in.
family_symbol (Autodesk.Revit.DB.FamilySymbol) – The family symbol to place.
target_placement_level (Autodesk.Revit.DB.Level) – The level to place the family instance on.
transaction_manager (function) – The transaction manager to use.
modify_action (function) – An action to run after the family instance is placed to modify its properties.
A result object.
Returns the location point of the family instance.
element (Autodesk.Revit.DB.FamilyInstance) – The family instance to get the location point of.
The location point of the family instance.
Autodesk.Revit.DB.XYZ
Returns the location curve of the element.
element (Autodesk.Revit.DB.Element) – The element to get the location curve of.
The location curve of the element.
Autodesk.Revit.DB.Curve
Rotates an element around its origin.
element (Autodesk.Revit.DB.Element) – The element to rotate.
angle (float) – The angle to rotate the element by in radians.
Rotates an element around its origin.
element (Autodesk.Revit.DB.Element) – The element to rotate.
angle (float) – The angle to rotate the element by in radians.
Moves an element from a start point to an end point. (assume same Z value)
element (Autodesk.Revit.DB.Element) – The element to move.
start_point (Autodesk.Revit.DB.XYZ) – The start point of the move.
end_point (Autodesk.Revit.DB.XYZ) – The end point of the move.
Bases: IFamilyLoadOptions
Defines behavior when a family is found in the model.
Overwrite parameter values is set to True.
familyInUse (_type_) – _description_
overwriteParameterValues (_type_) – _description_
True
bool
Defines behavior when a shared family is found in the model.
Overwrite parameter values is set to True. In case of any shared sub components already in the model but different in family loaded, the project version will be used.
sharedFamily (_type_) – _description_
familyInUse (_type_) – _description_
source (_type_) – _description_
overwriteParameterValues (_type_) – _description_
True
bool
Set parameter value based on the storage type of the parameter.
param_w (Parameter) – The parameter to set the value for.
manager (FamilyManager) – The family manager.
value (str) – The value to set the parameter to.
The result of the operation.
res.Result
Set parameter value.
doc (rdb.Document) – The Revit document.
manager (FamilyManager) – The family manager.
fam_para (Parameter) – The parameter to set the value for.
value (str) – The value to set the parameter to.
The result of the operation.
res.Result
Set parameter value as a formula.
doc (rdb.Document) – The Revit document.
manager (FamilyManager) – The family manager.
fam_para (rdb.Parameter) – The parameter to set the formula for.
formula (str) – The formula to set.
The result of the operation.
res.Result
Changes a shared family parameter to a standard family parameter.
Note: will need updating to support ForgeType fro Revit 2022 onwards
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
parameterName (str) – The shared parameter name.
prefix (str, optional) – Revit requires the new parameter to have a different name to the shard parameter, therefore a prefix to the name is applied, defaults to ‘_’
Result class instance.
Parameter change status returned in result.status. False if an exception occurred, otherwise True.
result.message will contain the name of the shared parameter and the new family parameter name.
result.status will contain the new family parameter.
On exception (handled by optimizer itself!):
result.status (bool) will be False.
result.message will contain generic exception message.
result.status will be an empty list
Associate a nested family instance parameter ( can be type or instance) with a host family parameter.
doc (Document) – The Revit document.
nested_family_instance (FamilyInstance) – The nested family instance.
target_parameter_name (str) – The target parameter name.
source_parameter_name (str) – The source parameter name.
The result of the operation.
res.Result
Filter the parameters by whether they are determined by a formula or not.
parameters (list) – The list of parameters
keep_if_formulae_driven (bool) – True to keep the parameters that are determined by a formula, False otherwise
The filtered list of parameters
list
Get the type parameters of the family.
doc (Document) – The family document
List of type parameters in the family document. if an exception occurred or the document is not a family document, None is returned.
This function sets any reference plane with reference type ‘weak’ within a family to reference type ‘not a reference’.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
Result class instance. - result.status (bool): True if at least one reference plane type was successfully changed; otherwise, False. - result.message (str): One row entry per reference plane requiring reference type change. - result.result (not used).
This function sets any model or symbolic curve in a family with reference type ‘weak’ to reference type ‘not a reference’.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
Result class instance. - result.status (bool): True if at least one curve reference type was successfully changed; otherwise, False. - result.message (str): One row entry per curve element requiring reference type change. - result.result (not used).
Reloads a number of families with setting: parameter values overwritten: True
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
library_location (str) – _description_
include_sub_folders (bool) – _description_
UserWarning – _description_
Returns True if any of the reload actions was successful.
bool
Get all loadable family ids in file
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
List of element ids representing loadable families.
list of Autodesk.Revit.DB.ElementId
Returns a list of symbol ids not present prior to reload.
Compares past in list of id’s and returns ids not in preloadSymbolIdList
pre_load_symbol_id_list (list of Autodesk.Revit.DB.ElementId) – List of Ids of symbols prior the reload.
after_load_symbol_list (list of Autodesk.Revit.DB.ElementId) – List of ids of symbols after the reload.
List of element ids representing Family Symbols.
list of Autodesk.Revit.DB.ElementId
Reloads a single family into a Revit document.
Will reload family provided in in path. By default the type parameter values in the project file will be overwritten with type parameter values in family.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
family (Autodesk.Revit.DB.family) – The family to be reloaded
family_file_path (str) – The fully qualified file path of the family to be re-loaded.
None
Result class instance.
Reload status (bool) returned in result.status.
Reload message: contains the reload log messages.
Return family reference stored in result.result property on successful reload only (single entry in list)
On exception
Reload.status (bool) will be False
Reload.message will contain the exception message
This helper function expect a folder containing rename directive files. For format of those files refer to module RevitFamilyRenameFilesUtils
Note:
The revit category is not used when renaming files but when renaming nested families.
Any associated type catalogue files will also be renamed to match the new family name.
Rename directives may not have the filePath property set if the directive is only meant to be used on loaded families.
Entry point for this module. Will read rename directives files in given directory and attempt to rename family files and any associated catalogue files accordingly.
Note: for rename directive file structure refer to module family_rename_files_utils
directory_path (str) – Fully qualified directory path to where rename directive files are located.
Result class instance.
result.status. True if files where renamed successfully, otherwise False.
result.message will contain each rename messages in format ‘old name -> new name’.
result.result empty list
On exception:
result.status (bool) will be False.
result.message will contain an exception message.
result.result will be empty
These helper function expect a text file in csv format with 4 columns:
Current family name: with out the file extension
File path : fully qualified file path to the family file.
Family category: the Revit category of the family.
New family name: the new family name without the file extension.
Note:
First row is treated as a header row and its content is ignored.
Retrieves file rename directives from a given folder location.
directory_path (str) – Fully qualified folder path to folder containing directives.
Result class instance.
result.status. True if rename directives where found and loaded successfully, otherwise False.
result.message will contain number of directives found in format:’Found rename directives: ‘ + number
result.result list of directives
On exception:
result.status (bool) will be False.
result.message will contain an exception message.
result.result will be empty
This helper function expect a folder containing rename directive files. For format of those files refer to module family_rename_files_utils.
Entry point for this module. Will read rename directives files in given directory and attempt to rename loaded families accordingly.
Note: for rename directive file structure refer to module family_rename_files_utils
directory_path (str) – Fully qualified directory path to where rename directive files are located.
Result class instance.
result.status. True if a single families was renamed successfully, otherwise False.
result.message will contain each rename messages in format ‘Renamed family from :’ +current Name + ‘ to ‘ + newName.
result.result empty list
On exception:
result.status (bool) will be False.
result.message will contain an exception message in format: ‘Failed to rename family from :’ + currentName + ‘ to ‘ + newName
result.result will be empty
This helper function expect a folder containing swap directive files. For format of those files refer to module RevitFamilyRenameFilesUtils
Note:
The revit category is used to uniquly identify the family to swap. It is assumed that the target family type belongs to a family of the same category.
Get the target type to swap to.
doc (Autodesk.Revit.DB.Document) – The current family document.
families ({str:Autodesk.Revit.DB.Family}) – dictionary of families where key is concatenated name + category and value is the family element.
swap_directive (class:.FamilyDirectiveSwap) – The swap directive.
Result class instance.
result.status. True if a single target family type was found, otherwise False.
result.message will contain each swap message
result.result list of target family types
On exception:
result.status (bool) will be False.
result.message will contain an exception message in format: ‘Failed to find target type for: ‘ + swap_directive.target_family_type_name
result.result will be empty
Get the super component id of a family instance.
doc (Autodesk.Revit.DB.Document) – The current family document.
instance (Autodesk.Revit.DB.FamilyInstance) – The family instance.
Result class instance.
result.status. True if a single super component was found, otherwise False.
result.message will contain each swap message
result.result list of super component ids (single entry)
On exception:
result.status (bool) will be False.
result.message will contain an exception message in format: ‘Failed to find super component for: ‘ + instance.Id
result.result will be empty
Get the group id of a family instance.
doc (Autodesk.Revit.DB.Document) – The current family document.
instance (Autodesk.Revit.DB.FamilyInstance) – The family instance.
Result class instance.
result.status. True if at least one group was found, otherwise False.
result.message will contain each swap message
result.result list of group ids
On exception:
result.status (bool) will be False.
result.message will contain an exception message in format: ‘Failed to find group for: ‘ + instance.Id
result.result will be empty
Entry point for this module. Will read swap directives files in given directory and attempt to swp out instances of types accordingly.
Note: for swap directive file structure refer to module family_swap_instances_by_type_utils
directory_path (str) – Fully qualified directory path to where swap directive files are located.
Result class instance.
result.status. True if a single families was swapped successfully, otherwise False.
result.message will contain each swap message
result.result empty list
On exception:
result.status (bool) will be False.
result.message will contain an exception message in format: ‘Failed to swap family from :’ + currentName + ‘ to ‘ + newName
result.result will be empty
Creates a new family type in the family document.
doc (Document) – The family document
type_name (str) – The name of the family type
Result object
:rtype
Deletes a family type from the family document.
Note: the type will not be deleted if it is the last type in the family!
doc (Document) – The family document
type_name (str) – The name of the family type
Result object
return all family type names
doc (Document) – The family document
Result object with the list of type names in .result
Family types can be filtered ( removed from the export ) by providing a list of filters. For available filters see the documentation in the module duHast.Utilities.compare alternatively inline filters can be provided as lambda functions.
filters = [[lambda x, y: x.startswith(y), “A”], [lambda x, y: x.endswith(y), “B”]]
The filters are applied to the family type names ( x in the above examples ). If the type name passes all filters it will be added to the catalogue file.
Check if the family type name passes the filters.
fam_type (FamilyTypeDataStorage) – The family type to check.
filters (list(list(function(value1,value2), test_value))) – The filters to apply to the types to be added to the catalogue file. If None, no filters will be applied and all types will be added. If more then one filter is provided, the types must pass all filters
True if the type name passes all filters, False otherwise.
bool
Pass family types through filters.
fam_type_manager (FamilyTypeDataStorageManager) – The family type manager to pass through the filters.
filters (list(list(function(value1,value2), test_value))) – The filters to apply to the types to be added to the catalogue file. If None, no filters will be applied and all types will be added. If more then one filter is provided, the types must pass all filters
The updated family type manager.
Get the type parameter order for the catalogue file.
doc (rdb.Family) – The family document to extract the type data from.
parameter_order (list(str)) – The order of the parameters in the catalogue file. If None, the parameters will be ordered alphabetically.
The type parameter order for the catalogue file with the result class .result property
Write the catalogue file to disk.
catalogue_file_data (list(list(str))) – The catalogue file data to write to disk.
family_file_path (str) – The path to the family file.
override_existing (bool) – If True, the existing catalogue file will be overwritten. If False, no catalogue file will be exported.
The result of the write operation.
Export the family types catalogue file.
doc (rdb.Family) – The family document to extract the type data from.
file_path (str) – The path to save the catalogue file. If None, the file will be saved in the same location as the family with the same name as the family.
filters (list(function(value1,value2))) –
The filters to apply to the types to be added to the catalogue file. If None, no filters will be applied and all types will be added. If more then one filter is provided, the types must pass all filters to be added. Filter format:
[[func(family_type_name, filter value), “my check value”],…]
filters = [[lambda x, y: x.startswith(y), “A”], [lambda x, y: x.endswith(y), “B”]]
parameter_order – The order of the parameters in the catalogue file. If None, the parameters will be ordered alphabetically.
override_existing – If True, the existing catalogue file will be overwritten. If False, no catalogue file will be exported.
Supports 2 methods of data extraction:
from family file on disk
from family element instance in document
Get the family type data from the family document using the XML extraction method. This can be used to extract the type data from a family document within a Revit session but without opening the family in Revit.
application (Autodesk.Revit.ApplicationServices.Application) – The Revit application object.
family_name (str) – The name of the family.
family_path (str) – The path of the family file.
use_temporary_file (bool) – Whether to use a temporary file for the XML data.
A result object with .result containing a single FamilyTypeDataStorageManager object. (or empty if failed)
Get the family type data from xml files in the library. XML where created by Revit API PartAtomExport method.
xml_files_in_libraries ([FileItem
]) – list of xml files to search for type data
progress_callback (ProgressBase
) – progress callback object
Result class instance.
result.status: XML conversion status will be returned in result.status. False if an exception occurred, otherwise True.
result.message will contain which xml file was read and converted into family type data.
result.result will be [FamilyTypeDataStorageManager
]
On exception
Reload.status (bool) will be False
Reload.message will contain the exception message
Reload.result will be an empty list
Supports 2 methods of data extraction:
from family file on disk
from family element instance in document
Get the family type data from the family element in a REvit document using the XML extraction method.
revit_family (Autodesk.Revit.DB.Family) – The Revit family object.
family_name_nesting_path (str) – The nesting path of the family in a tree: rootFamilyName :: nestedFamilyNameOne :: nestedFamilyTwo This includes the actual family name as the last node.
root_category_path – The path of the family category in a tree: rootCategoryName :: nestedCategoryNameOne :: nestedCategoryTwo This includes the actual category name as the last node.
A result object with .result containing a single FamilyTypeDataStorage object. (or empty if failed)
Loads or reloads a single family into a Revit document.
Will load/ reload family provided in in path. By default the parameter values in the project file will be overwritten with parameter values in family.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
family_file_path (str) – The fully qualified file path of the family to be loaded.
transaction_manager (function) – A function wrapping the load family action in a transaction. Default is in_transaction_with_failure_handling. None assumes a transaction is already in progress.
failure_config (FailureHandlingConfig) – The failure handling configuration object. Default is FailureHandlingConfig()
failure_processing_func (function) – The function to process failures. Default is process_failures
None
Result class instance.
Reload status (bool) returned in result.status.
Reload message: contains the reload log messages.
Return family reference stored in result.result property on successful reload only
On exception
Reload.status (bool) will be False
Reload.message will contain the exception message
Filters all family symbols (Revit family types) of given built in categories from the Revit model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
cats (ICollection :cats sample: cats = List[rdb.BuiltInCategory] ([rdb.BuiltInCategory.OST_Furniture, rdb.BuiltInCategory.OST_Parking])) – ICollection of Autodesk.Revit.DB.BuiltInCategory values.
A collector of Autodesk.Revit.DB.Element matching filter.
Autodesk.Revit.DB.FilteredElementCollector
Filters all family instances of given built in categories from the Revit model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
cats (ICollection :cats sample: cats = List[rdb.BuiltInCategory] ([rdb.BuiltInCategory.OST_Furniture, rdb.BuiltInCategory.OST_Parking])) – ICollection of Autodesk.Revit.DB.BuiltInCategory values:
A collector of Autodesk.Revit.DB.Element matching filter.
Autodesk.Revit.DB.FilteredElementCollector
Filters all family instances of a single given built in category from the Revit model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
builtin_cat (Autodesk.Revit.DB.BuiltInCategory) – single revit builtInCategory Enum value.
A collector of Autodesk.Revit.DB.FamilyInstance matching filter.
Autodesk.Revit.DB.FilteredElementCollector
Filters all families in revit model by whether it is not an InPlace family.
Note: slow filter due to use of lambda and cast to list.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A list of families matching filter.
list Autodesk.Revit.DB.Family
Get all loadable family ids in file.
doc (Autodesk.Revit.DB.Document) – Current family document.
list of family ids
[Autodesk.Revit.DB.ElementId]
Filters all families in revit model by whether it is an InPlace family.
Note: slow filter due to use of lambda and cast to list
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A list of families matching filter.
list Autodesk.Revit.DB.Family
Returns all family instances in document.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A collector with all family instances in document.
Autodesk.Revit.DB.Collector
Checks whether any family instance in document is driven by the ‘Label’ property.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
True if at least one instance is driven by label property. Otherwise False
bool
Get all family types belonging to the same family as types past in.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
type_ids (list of Autodesk.Revit.DB.ElementId) –
list of element id’s representing family symbols (family types)
dictionary: where key is the family id as Autodesk.Revit.DB.ElementId value is a list of all symbol(family type) ids as Autodesk.Revit.DB.ElementId belonging to the family
dic {Autodesk.Revit.DB.ElementId: list[Autodesk.Revit.DB.ElementId]}
Filters all family instances of a single given family symbol (type).
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
type_id (Autodesk.Revit.DB.ElementId) – The symbol (type) id
A collector of Autodesk.Revit.DB.FamilyInstance matching filter.
Autodesk.Revit.DB.FilteredElementCollector
Return number of instances in the model ( fast!)
family_symbol (Autodesk.Revit.DB.FamilySymbol) – A family type
A c# IList of dependent element ids.
IList<ElementId>
Filters family symbol (type) ids off all available in place families of single given built in category.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
fam_built_in_category (Autodesk.Revit.DB.BuiltInCategory) – built in revit category
A list of Element Ids representing the family symbols matching filter.
list Autodesk.Revit.DB.ElementId
Filters family symbols belonging to list of built in categories past in.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
cats (cats = List[rdb.BuiltInCategory] ([rdb.BuiltInCategory.OST_Furniture, rdb.BuiltInCategory.OST_Parking])) – ICollection of Autodesk.Revit.DB.BuiltInCategory values.
A list of Element Ids representing the family symbols matching filter.
list Autodesk.Revit.DB.ElementId
Filters family symbols (types) belonging to hard coded categories lists (catsLoadableThreeD, catsLoadableTags)
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A list of Element Ids representing the family symbols matching filter.
list of Autodesk.Revit.DB.ElementId
Returns if the family is shared (true) or not (false)
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
family_symbol (Autodesk.Revit.DB.Family) – The family
True if family is shared, otherwise False
bool
Returns if the family is shared (true) or not (false)
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
family_symbol (Autodesk.Revit.DB.FamilySymbol) – The family symbol (type)
True if family is shared, otherwise False
bool
Checks if symbols (types) of a family are in use in a model. Check is done by comparing entries of fam_type_ids with used_type_ids. :param fam_type_ids: list of symbol(type) ids of a family :type fam_type_ids: list Autodesk.Revit.DB.ElementId :param used_type_ids: list of symbol(type) ids in use in a project :type used_type_ids: list Autodesk.Revit.DB.ElementId :return: False if a single symbol id contained in list fam_type_ids has a match in list used_type_ids, otherwise True. :rtype: bool
Filters symbol (type) IDs and family IDs of families.
The returned list of IDs can be either unused family symbols or entire families if none of their symbols are in use. In terms of purging, it’s faster to delete an entire family definition rather than deleting its symbols first and then the definition.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
unused_type_getter (function (doc) -> list of Autodesk.Revit.DB.ElementId) – A function returning IDs of unused symbols (family types) as a list. It requires the current model document as an argument.
A list of Element IDs representing the family symbols and/or family IDs matching the filter.
list of Autodesk.Revit.DB.ElementId
Filters types obtained by passing in the type_id_getter method and, depending on use_type, returns either the used or unused symbols of a family.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
type_id_getter (function (doc, ICollection, bool) -> list of Autodesk.Revit.DB.ElementId) – A function returning IDs of symbols (family types) as a list. It requires the following arguments: - The current model document. - ICollection of built-in categories. - A boolean: exclude shared families.
use_type (int) – 0 for no dependent elements (not used); 1 for has dependent elements (is in use).
A list of Element IDs representing the family symbols matching the filter.
list of Autodesk.Revit.DB.ElementId
Filters unused non shared family (symbols) type ids in model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param exclude_shared_fam: Default is True (exclude any shared families from filter result) :type exclude_shared_fam: bool :return: A list of Element Ids representing the family symbols matching filter. :rtype: list of Autodesk.Revit.DB.ElementId
Filters unused, non shared and in place family (symbols) type ids in model which can be purged from the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A list of Element Ids representing the family symbols matching filter. :rtype: list of Autodesk.Revit.DB.ElementId