Sample Code Revit Batch Processor 1.1.11 documentation
Gets all fill pattern elements in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector of all fill pattern elements. :rtype: Autodesk.Revit.DB.FilteredElementCollector
Returns a dictionary where fill pattern name is key, values are all ids of line patterns with the exact same name.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A dictionary where fill pattern name is key, values are all ids of line patterns with the exact same name
dictionary(key str, value list of Autodesk.Revit.DB.ElementId)
Returns a list of all fill pattern ids used in filled region types in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A list of all fill pattern ids used in filled region types in the model.
list of Autodesk.Revit.DB.ElementId
pattern name
pattern name default value, hard coded solid line pattern name
pattern id
Returns the line pattern properties as a dictionary where keys are pattern name and pattern id.
cat (Autodesk.REvit.DB.Category) – A category.
doc (Autodesk.Revit.DB.Document) – Current Revit family document.
A dictionary.
dictionary {str: str, str: Autodesk.Revit.DB.ElementId}
Returns the line pattern properties as a dictionary where keys are pattern name and pattern id.
doc (Current Revit family document.) – Current Revit family document.
level (Autodesk.Revit.DB.Level) – a level element
A dictionary.
dictionary {str: str, str: Autodesk.Revit.DB.ElementId}
Deletes all line patterns where the names contains a provided string
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
contains (str) – Filter: pattern name needs to contain this string to be deleted.
Result class instance.
.status True if line pattern where deleted successfully. Otherwise False.
.message will contain delete status per pattern.
Deletes all line patterns where the name starts with provided string.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
starts_with (str) – Filter: pattern name needs to start with this string to be deleted.
Result class instance.
.status True if line pattern where deleted successfully. Otherwise False.
.message will contain delete status per pattern.
Deletes all line patterns where the name does not contain the provided string.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
contains (str) – Filter: pattern name needs not to contain this string to be deleted.
Result class instance.
.status True if line pattern where deleted successfully. Otherwise False.
.message will contain delete status per pattern.
Gets all line patterns in the model.
doc (_type_) – _description_
filtered element collector of all line pattern elements in model.
Autodesk.Revit.DB.FilteredElementCollector
Returns a dictionary where line pattern name is key, values are all ids of line patterns with the exact same name.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A dictionary where line pattern name is key, values are all ids of line patterns with the exact same name
dictionary(key str, value list of Autodesk.Revit.DB.ElementId)
Deletes all but the first line pattern by Id with the exact same name.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
Result class instance.
.status True if all views where deleted. Otherwise False.
.message will contain deletion status.
Deletes all line styles where the name starts with provided string
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
starts_with (str) – Filter: style name needs to start with this string to be deleted.
Result class instance.
.status True if all views where deleted. Otherwise False.
.message will contain deletion status.
Gets all line styles ids in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A list of all line style ids. :rtype: list of Autodesk.Revit.DB.ElementId
Gets all graphics style ids by line style id in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A dictionary of all line style ids as integer values with their corresponding graphics style ids as integer values. :rtype: dict
Returns all fill pattern ids in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
element_ids ([Autodesk.Revit.DB.ElementId]) – optional list of fill pattern element ids
element_ids_list_is_inclusive_filter (bool) – If true and element_ids list has values only those patterns will be purged if possible. If false and element_ids list has values any patterns in the list will not be purged.
A list of all fill pattern ids in the model.
list of Autodesk.Revit.DB.ElementId
Purge fill pattern by delete.
Note: This is a very slow process and can take a few hours to complete depending on the size of the model and the number of fill patterns.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
progress_callback (callable) – Callback to report progress.
debug (bool) – Debug mode.
element_ids ([Autodesk.Revit.DB.ElementId]) – optional list of fill pattern element ids
element_ids_list_is_inclusive_filter (bool) – If true and element_ids list has values only those fill patterns will be purged if possible. If false and element_ids list has values any fill patterns in the list will not be purged.
Result class instance.
.status True if unused fill pattern where deleted or nothing needed to be deleted. Otherwise False.
.message will contain deletion status.
Returns all line pattern ids in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
element_ids ([Autodesk.Revit.DB.ElementId]) – optional list of shared parameter element ids
element_ids_list_is_inclusive_filter (bool) – If true and element_ids list has values only those line patterns will be purged if possible. If false and element_ids list has values any line patterns in the list will not be purged.
A list of all line pattern ids in the model.
list of Autodesk.Revit.DB.ElementId
Purge line pattern by delete.
Note: This is a very slow process and can take a few hours to complete depending on the size of the model and the number of line patterns.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
progress_callback (callable) – Callback to report progress.
debug (bool) – Debug mode.
element_ids ([Autodesk.Revit.DB.ElementId]) – optional list of shared parameter element ids
element_ids_list_is_inclusive_filter (bool) – If true and element_ids list has values only those parameters will be purged if possible. If false and element_ids list has values any parameters in the list will not be purged.
Result class instance.
.status True if unused line pattern where deleted or nothing needed to be deleted. Otherwise False.
.message will contain deletion status.
Returns all line style ids in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
element_ids ([Autodesk.Revit.DB.ElementId]) – optional list of line style element ids
element_ids_list_is_inclusive_filter (bool) – If true and element_ids list has values only those line styles will be purged if possible. If false and element_ids list has values any line styles in the list will not be purged.
A list of all line styles ids in the model.
list of Autodesk.Revit.DB.ElementId
Purge line styles by delete.
Note: This is a quick(ish) process and can take a few minutes to complete depending on the size of the model and the number of line styles.
Observations:
when deleting a line style in Revit, the associated graphics style will be deleted as well. Which leads to a minimum of 2 deleted elements per line style.
a custom element deleted modifier is used to check if the deleted element count is 2 and if the second deleted element is the associated graphics style.
if that is the case and no modified elements are listed, the deleted element count is reduced to 1 and the line style is considered as deleted.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
progress_callback (callable) – Callback to report progress.
debug (bool) – Debug mode.
element_ids ([Autodesk.Revit.DB.ElementId]) – optional list of line style element ids
element_ids_list_is_inclusive_filter (bool) – If true and element_ids list has values only those line styles will be purged if possible. If false and element_ids list has values any line styles in the list will not be purged.
Result class instance.
.status True if unused line styles where deleted or nothing needed to be deleted. Otherwise False.
.message will contain deletion status.