Sample Code Revit Batch Processor 1.1.11 documentation
Deletes views based on view rules supplied.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
view_rules (list of lists, where each inner list has the format [parameter name, condition test method, value to test against]) – Rules used to check whether a view should be deleted. Rules are based on parameters attached to views and their values.
collector_views (Autodesk.Revit.DB.FilteredElementCollector) – A filtered element collector containing views.
Result class instance. - result (bool): True if all views were deleted, otherwise False. - message (str): Deletion status.
Deletes all views not placed on sheets, including schedules and legends matching the given filter.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
filter (function(view) -> bool) – A function that checks whether a view should be deleted.
Result class instance. - result (bool): True if all views were deleted, otherwise False. - message (str): Deletion status.
Deletes all unused elevation markers (no elevation is created by the marker).
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
Result class instance. - result (bool): True if all unused elevation markers were deleted, otherwise False. - message (str): Deletion status.
Deletes sheets based on rules.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
view_rules (array in format [parameter name, condition test method, value to test against) – A set of rules. If view matches rule it will be deleted.
collector_views (Autodesk.Revit.DB.FilteredElementCollector) – A filtered element collector containing view instances.
Result class instance. - .status True if all sheets matching filter where deleted. Otherwise False. - .message will contain deletion status.
Deletes all sheets in a model
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
Result class instance. - .status True if all sheets where deleted. Otherwise False. - .message will contain deletion status.
Overwrite the graphics of elements in a view.
Note: If None is passed as the override_graphics_settings parameter, the default settings will be used to remove any overrides on the elements.
doc (Document) – The Revit document.
view (View) – The view in which the elements are located.
elements (list) – The elements to overwrite the graphics for.
override_graphics_settings (Autodesk.Revit.DB.OverrideGraphicSettings) – The override settings to apply to the elements.
A result object.
Creates an elevation marker and associated elevation views in the Revit document.
This function creates an elevation marker at the specified location and, if defined through their indicis, creates elevation views on that marker. It sets various properties for the views, such as names, phasing, and crop box settings. The function can handle transactions and failure handling as specified.
doc (Autodesk.Revit.DB.Document) – The Revit document where the elevation marker and views will be created.
view_type (Autodesk.Revit.DB.ViewFamilyType) – The type of the elevation view to be created.
view_marker_location (Autodesk.Revit.DB.XYZ) – The location where the elevation marker will be placed.
scale (int) – The initial scale of the elevation views.
view_index_list (list of int, optional) – List of indices specifying which elevation views on the marker to create, defaults to an empty list.
view_names (list of str, optional) – List of names to assign to the created elevation views, defaults to an empty list.
view_plan (Autodesk.Revit.DB.ViewPlan, optional) – The plan view to associate with the elevation views, defaults to None. Only required if elevation views are to be created (not just a marker)
phasing (Autodesk.Revit.DB.Element, optional) – The phase to assign to the new views, defaults to None.
view_crop (Autodesk.Revit.DB.BoundingBoxXYZ or Autodesk.Revit.DB.CurveLoop, optional) – The crop box or loop to apply to the views, defaults to None.
view_crop_visible (bool, optional) – Flag indicating whether the crop box should be visible, defaults to True.
transaction_manager (function, optional) – The transaction manager to handle transactions and failure handling, defaults to in_transaction_with_failure_handling. Set to None if a transaction is already running.
ValueError – If the elevation marker or views cannot be created.
A Result object containing the outcome of the elevation creation process.
Gets all filters in document as a collector
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A filtered Element collector containing Autodesk.Revit.DB.ParameterFilterElement
Autodesk.Revit.DB.FilteredElementCollector
Gets all view filter ids in document
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
All view filter Id’s which are in the model.
list of Autodesk.Revit.DB.ElementId
Retrieves a filter by its name from the current Revit model document.
doc (Revit Document): The current Revit model document. filter_name (str): The name of the filter to be retrieved.
Filter: The filter with the specified name, if found. None: If no filter with the specified name is found.
Returns past in list of filter id’s plus new unique filter id’s from view (if not already in list past in)
view (Autodesk.Revit.DB.View) – The view of which to get the filters from.
unique_list (list of Autodesk.Revit.DB.ElementId) – List containing view filters
List containing past in view filters and new view filters.
list of Autodesk.Revit.DB.ElementId
Checks if a filter is already applied to a view in Autodesk Revit.
view (Autodesk.Revit.DB.View): The view object to check if the filter is applied. filter (Autodesk.Revit.DB.Filter): The filter object to check if it is applied to the view.
bool: True if the filter is applied to the view, False otherwise.
Gets all filter id’s used in view templates only. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List containing filter Id’s. :rtype: list of Autodesk.Revit.DB.ElementId
Gets all filter id’s from views which dont have a template applied and match a given view type. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param filter_by_type: list of view types of which the filters are to be returned. :type filter_by_type: list of Autodesk.Revit.DB.ViewType :return: List containing filter Id’s. :rtype: list of Autodesk.Revit.DB.ElementId
Gets id’s of all unused view filters in a model :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List containing filter Id’s. :rtype: list of Autodesk.Revit.DB.ElementId
Applies a filter to a view in Autodesk Revit.
doc (Autodesk.Revit.DB.Document): The document object representing the Revit model. view (Autodesk.Revit.DB.View): The view object to which the filter should be applied. filter (Autodesk.Revit.DB.Filter): The filter object that should be applied to the view.
duHast.Utilities.Objects.result.Result: The result object containing the outcome of applying the filter to the view. The result attribute of the result object indicates whether the filter was applied successfully or not. The messages attribute of the result object contains any additional messages related to the application of the filter.
Get all view legends in a model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
All view legends in the model
list of Autodesk.Revit.DB.View
Returns all unplaced legend views
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
All view legends in the model not on a sheet
list of Autodesk.Revit.DB.View
Creates a new plan view in the Revit document.
This function creates a new plan view in the specified Revit document, sets its properties, and handles any errors that occur during the process. The function supports setting the view name, phasing, and crop box properties.
doc (Autodesk.Revit.DB.Document) – The Revit document where the view will be created.
level (Autodesk.Revit.DB.Level) – The level at which the view will be created.
view_type (Autodesk.Revit.DB.ViewFamilyType) – The type of the view to be created.
view_name (str, optional) – The name to assign to the new view, defaults to None.
phasing (Autodesk.Revit.DB.Element, optional) – The phase to assign to the new view, defaults to None.
view_crop (Autodesk.Revit.DB.BoundingBoxXYZ or Autodesk.Revit.DB.CurveLoop, optional) – The crop box or loop to apply to the view, defaults to None.
view_crop_visible (bool, optional) – Flag indicating whether the crop box should be visible, defaults to True.
A Result object containing the outcome of the view creation process.
this will return an EMPTY filtered element collector of all call out types in the model in Revit 2019
this will return an EMPTY filtered element collector of all reference view types in the model in Revit 2019
this will return an EMPTY filtered element collector of all call out type ids in the model
this will return an EMPTY filtered element collector of all reference view types in the model
Gets a filtered element collector of all callOut Head symbol (types) in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A filtered element collector containing call out head symbols.
Autodesk.Revit.DB.FilteredElementCollector
Gets a filtered element collector of all elevation symbols (types) in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A filtered element collector containing elevation symbols.
Autodesk.Revit.DB.FilteredElementCollector
Gets a filtered element collector of all section symbols (types) in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A filtered element collector containing section symbols.
Autodesk.Revit.DB.FilteredElementCollector
Gets a filtered element collector of all view continuation symbols (types) in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A filtered element collector containing Continuation Marker symbols.
Autodesk.Revit.DB.FilteredElementCollector
Gets filtered element collector of all reference view elements in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A filtered element collector containing reference view elements.
Autodesk.Revit.DB.FilteredElementCollector
contains the builtin parameter definitions for Call out type ids, section type ids, elevation type ids
contains the builtin parameter definitions for call out symbol tag ids, section symbol tag ids, elevation symbol tag ids
category filter for all view ref categories
Gets all reference type ids used in view type.
view_type (Autodesk.Revit.DB.ViewType) – The view type.
dictionary, key: BuiltinParameterDefinition, value: id of a tag
dic{Autodesk.Revit.DB.BuiltinParameterDefinition:[Autodesk.Revit.DB.ElementId]}
Gets all view references types in use in the model in a dictionary.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
key is the reference tag type: call out, section or elevation, values are the type ids in use
dictionary {reference tag type: list Autodesk.Revit.DB.ElementIds}
Gets all view references types available in the model in a dictionary.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
key is the reference type: call out, section or elevation, values are the type ids in use
dictionary {reference tag type: list Autodesk.Revit.DB.ElementIds}
Gets all view references type ids available in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A list of element ids representing view reference types
list Autodesk.Revit.DB.ElementIds
Gets all view continuation type ids available in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
List of view continuation type ids.
list Autodesk.Revit.DB.ElementIds
returns all view continuation types available in the model
Gets the ids of all view reference family symbols(types) in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
List of view reference family symbols(types) ids.
list Autodesk.Revit.DB.ElementIds
‘Gets the ids of all view family symbols(types) from given view ref types or continuation types the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
view_ref_types_ids (list Autodesk.Revit.DB.ElementId) – list of ids representing view reference types or continuation types
List of ids of all view family symbols(types).
list Autodesk.Revit.DB.ElementId
Get the ids of all view reference symbols(types) and view continuations symbols (types) used by view reference types and view continuation types in the model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
List of ids of all view family symbols(types).
list Autodesk.Revit.DB.ElementId
Gets nested family names from provided symbols.
Retrieves a families from the symbols provided.
Opens the family document and extracts the names off all nested families within.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
used_ids (list of Autodesk.Revit.DB.ElementId) – List of symbol ids.
List of all unique nested family names.
list str
Gets view ids of all schedules with instances placed on a sheet
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
List containing schedule Id’s.
list of Autodesk.Revit.DB.ElementId
Gets all schedules without an instance placed on a sheet.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
list of schedules without a sheet schedule instance.
list of Autodesk.Revit.DB.View
Returns a list containing all schedule sheet instances on a sheet.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
sheet (Autodesk.Revit.DB.ViewSheet) – A sheet
a list of schedule sheet instances or empty list if none found
[Autodesk.revit.DB.ScheduleSheetInstance]
Checks whether a view is a revision schedule. (not required…schedules have a property flag!!)
view (Autodesk.Revit.DB.View) – The view to check.
True if the view name starts with ‘<’, otherwise False
bool
Checks if the view is of type schedule. If so it returns true, otherwise false
view (Autodesk.Revit.DB.View) – the view
True if view is a schedule, otherwise false.
:rtype:bool
Gets sheets matching filters provided :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param view_rules: A set of rules. If sheet matches rule it will be returned. Defaults to None which will return all sheets. :type view_rules: array in format [parameter name, condition test method, value to test against], optional
Views matching filter
list of Autodesk.Revit.DB.View
Gets all sheets in a model :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: list of sheet views :rtype: list of Autodesk.Revit.DB.View
Returns the revision of a sheet identified by its number. Default value is ‘-‘.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
sheet_number (str) – The number of the sheet of which the revision is to be returned.
Any exception will need to be managed by the function caller.
The sheet’s current revision value. If no matching sheet is found, ‘-’ is returned.
str
Returns the revision of a sheet identified by its name. Default value is ‘-‘.
Since multiple sheets can have the same name, it will return the revision of the first sheet matching the name.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
sheet_name (str) – The name of the sheet of which the revision is to be returned.
Any exception will need to be managed by the function caller.
The sheet’s current revision value. If no matching sheet is found, ‘-’ is returned.
str
Get a dictionary of sheet numbers and sheets :param rvt_doc: The Revit document to get the sheets from :type rvt_doc: Document :return: A dictionary of sheet numbers and sheets :rtype: dict
Returns the first title block located on a sheet or None if there is none placed.
doc (Autodesk.Revit.DB.Document): Current Revit model document. sheet (Autodesk.Revit.DB.ViewSheet):The sheet of which to return the title block from
Autodesk.Revit.DB.FamilyInstance: The first title block instance on a sheet or None.
Creates a revit sheet.
doc (Document) – The Revit document.
sheet_number (str) – The new sheet number
sheet_name (str) – The new sheet name
title_block_family_symbol (Autodesk.Revit.DB.FamilySymbol) – The title block type to be used
additional_properties (dict, optional) – a dictionary representing parameter names on the new sheet and their value, defaults to {}
ValueError – If sheet number is not a string
ValueError – If sheet name is not a string
ValueError – If title_block_family_symbol is not a Autodesk.Revit.DB.FamilySymbol
ValueError – If sheet failed to create
Result class instance.
.status True if sheet was created and parameters where updated successfully. Otherwise False.
.message will contain stats.
.result will be a list containing the sheet instance created.
Get all view templates in a model.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
All view templates in the model
list of Autodesk.Revit.DB.View
Get all view template ids in a model
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
All view templates Id’s in the model
list of Autodesk.Revit.DB.ElementId
Returns a list of view template which allow graphical overrides to be applied.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
list
[Autodesk.Revit.DB.View]
Gets ids of view templates used in views in the model only :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: All used view templates Id’s in the model :rtype: list of Autodesk.Revit.DB.ElementId
Returns a view template by its name.
doc (Autodesk.Revit.DB.Document) – The current model document.
view_template_name (str) – The view template name.
A view template if name matches, otherwise None
Autodesk.Revit.DB.View
Gets view template Id’s used as default by view types
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
All view templates Id’s which are used as default in view types in the model
list of Autodesk.Revit.DB.ElementId
Get all used view template Id’s.
Templates can either be: - used as default by view types - used by a view
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
All view templates Id’s which are used in the model.
list of Autodesk.Revit.DB.ElementId
Get all templates in a model of given type
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
filter_by_type (list of Autodesk.Revit.DB.ViewType) – List of view types of which to return view templates from
All view templates in the model
list of Autodesk.Revit.DB.View
Gets all view template Id’s not used by view types or by views :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: All view templates Id’s which are not used in the model. :rtype: list of Autodesk.Revit.DB.ElementId
Returns all view family types in a model :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: A filtered element collector. :rtype: Autodesk.Revit.DB.FilteredElementCollector
Returns all view family type ids in a model
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
ids of view family types
list of Autodesk.Revit.DB.ElementId
Gets all views in a model of a given type. Excludes templates.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
view_type (Autodesk.Revit.DB.ViewType) – Filter: the view type
list of views
list of Autodesk.Revit.DB.View
Get all view ports on sheets provided.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
sheets (list of Autodesk.Revit.DB.ViewSheet) – list of sheets of which to return the view ports from.
list of view ports
list of Autodesk.Revit.DB.Viewport
Gets all views in a model which are matching a filter and are:
not template views
not system browser
not project browser
not undefined
not Internal
not sheets
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
filter (func(view) returning a bool) – function checking view
list of views
list of Autodesk.Revit.DB.View
Gets all views not placed on a sheet. (Excludes schedules)
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
A list of views which are currently not placed on a sheet.
list of Autodesk.Revit.DB.View
Get the views phase id.
Note if view does not support phase id and Invlaid ElementId (-1) is returned
view (Autodesk.Revit.DB.View) – The view of which to return the phase id
An element id representing the phase id. If view does not support phases then an Invalid id (-1) will be returned.
list of Autodesk.Revit.DB.ElementId
Returns the area scheme an area plan is associated with.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
view (Autodesk.Revit.DB.View) – The view of which to return the area scheme
The area scheme if the view is of type AreaPlan otherwise None
str or None
Get the crop region loops of a view.
This method returns a representation of the boundaries of the currently active crop for the associated view. If the view crop has a non-rectangular shape, the method returns that shape. Otherwise, if the view crop has been split, the method returns the multiple rectangular boundaries visible in the crop - note that this does not reflect any offsets that may have been applied to the boundary regions. If the crop is not split, this returns a single rectangle representing the crop. All coordinates are in the coordinate frame of the view.
view (Autodesk.Revit.DB.View) – The view to get the crop region from.
The crop region of the view.
[Autodesk.Revit.DB.CurveLoop]
Apply a crop region to a view.
This method sets the crop region of the view to the specified crop loops.
view (Autodesk.Revit.DB.View) – The view to apply the crop region to.
crop_loops (Autodesk.Revit.DB.CurveLoop) – The crop loop to apply to the view.
The result of the operation.
Apply a crop region to a view.
This method sets the crop region of the view to the specified crop loops.
doc (Autodesk.Revit.DB.Document) – The document containing the view.
view (Autodesk.Revit.DB.View) – The view to apply the crop region to.
crop_loops (Autodesk.Revit.DB.CurveLoop) – The crop loop to apply to the view.
The result of the operation.
Apply a crop region to a view.
This method sets the crop region of the view to the specified crop loops.
view (Autodesk.Revit.DB.View) – The view to apply the crop region to.
bbox – The bounding box to apply as crop to the view.
The result of the operation.
Apply a crop region to a view.
This method sets the crop region of the view to the specified crop loops.
doc (Autodesk.Revit.DB.Document) – The document containing the view.
view (Autodesk.Revit.DB.View) – The view to apply the crop region to.
bbox – The bounding box to apply as crop to the view.
The result of the operation.
Gets all unused view continuation type ids in model for purge. This method can be used to safely delete all unused view continuation marker types. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids. :rtype: list Autodesk.Revit.DB.ElementId
Returns true if symbol belongs to family in list past in. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :param id: The element id of a symbol. :type id: Autodesk.Revit.DB.ElementId :param nested_family_names: list of family names know to be nested families. :type nested_family_names: list str :return: True if family name derived from symbol is in list past in, otherwise False. :rtype: bool
Gets the ids of all view reference symbols(types) and view continuation symbols (types) not used in the model. Not used: These symbols are not used in any view reference types, or nested in any symbols used in view reference types. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids. :rtype: list Autodesk.Revit.DB.ElementId
Gets the ids of all view reference symbols(types) ids and or family ids not used in the model for purging. This method can be used to safely delete all unused view reference and continuation marker family symbols or families. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids. :rtype: list Autodesk.Revit.DB.ElementId
Gets all unused view references type ids in model for purge. This method can be used to safely delete all unused view reference types. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: List of element ids. :rtype: list Autodesk.Revit.DB.ElementId
Returns all view family types in use in the model. :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: ids of view family types in use :rtype: list of Autodesk.Revit.DB.ElementId
Returns all unused view family types in the model :param doc: Current Revit model document. :type doc: Autodesk.Revit.DB.Document :return: ids of view family types not in use :rtype: list of Autodesk.Revit.DB.ElementId
Reads JSON data from a file and converts it into a dictionary of ViewGraphicsSettings objects.
file_path (str): The fully qualified file path of the JSON file. call_back (function): A callback function to update the progress of the data import.
dict: A dictionary of ViewGraphicsSettings objects, where the view name is the key and the ViewGraphicsSettings object is the value.
Check whether the line patterns used in the line_pattern_data exist in the Revit model.
doc (Revit Document): The Revit document object. line_pattern_data (dictionary): A dictionary containing line pattern data.
Result: A Result object containing the results of the line pattern check.
Check whether all fill patterns used in the fill_pattern_data exist in the Revit model.
doc (Revit Document): The Revit document object. fill_pattern_data (dict): A dictionary containing fill pattern data.
Result: A Result object containing the results of the fill pattern check.
Check whether all line patterns and fill patterns used in the view_overrides_data exist in the model.
doc (Revit Document): The Revit document object. view_overrides_data (dict): A dictionary containing view overrides data.
Result: A Result object containing the results of the line pattern and fill pattern checks.
Returns a dictionary containing the view templates that match the view names specified in the view_overrides_data dictionary.
doc (Autodesk.Revit.DB.Document): The current Revit model document. view_overrides_data (dict): A dictionary containing view override data. The keys are view names and the values are objects of type ViewOverrideData.
dict: A dictionary containing the view templates that match the view names specified in the view_overrides_data dictionary. The keys are view names and the values are tuples containing the view template and the corresponding view override data.
Apply graphic and filter overrides to a Revit view.
doc (Revit Document): The current Revit document. view (Revit View): The view to apply the overrides to. view_override (ViewOverride): An object containing the desired graphic and filter overrides.
Result: A result object containing the status of the override application, any error messages, and additional information.
Applies graphic and filter overrides to multiple views in a Revit document.
doc (Revit Document): The current Revit document. view_data (dict): A dictionary where the keys are the names of the views and the values are lists containing the Revit view object and the view override object.
Result: A result object containing the status of the override application, any error messages, and additional information.
Applies graphic and filter overrides to multiple views in a Revit document based on data imported from a JSON file.
doc (Revit Document) – The current Revit document.
file_path (str) – The fully qualified file path of the JSON file containing the view override data.
A result object containing the status of the override application, any error messages, and additional information.
Example Usage: >>> result = apply_overrides_from_file(doc, file_path) >>> if result.status: … print(“Overrides applied successfully.”) >>> else: … print(“Failed to apply overrides:”, result.message)
Returns all categories and sub categories in a model in a dictionary:
Dictionary:
key is same format as list: main category name::sub category name
value is a named tuple category_storage instance
doc (Autodesk.Revit.DB.Document) – The current model document.
dictionary of categories
{str:category_storage}
Populates the category_override and is_category_hidden field of a ‘category_storage’ instance based on the view past in.
view (Autodesk.Revit.DB.View) – The view from which the category override is to be used.
category_storage_instance (RevitCategoryOverride
) – An instances of revit category storage containing no view specific information.
An updated instances of revit category storage now containing the override, category visibility flags.
Populates the category_override and is_category_hidden fields of a list of ‘category_storage’ instances based on the view past in.
view (Autodesk.Revit.DB.View) – The view from which the category override is to be used.
category_storage_instances ([RevitCategoryOverride
]) – A list of instances of class ‘RevitCategoryOverride’
A list of instances of revit category storage now containing the override, category visibility flags.
Applies graphic override(s) to a single view
doc (Autodesk.Revit.DB.Document) – The current model document.
view (Autodesk.Revit.DB.View) – The view on which the category override is to be used.
category_storage_instances ([RevitCategoryOverride
]) – A list of instances of class ‘RevitCategoryOverride’
Result class instance.
Apply override status returned in result.status. False if an exception occurred, otherwise True.
result.message will contain message ‘Successfully set category override…’ for each override applied.
result.result will be an empty list
On exception:
result.status (bool) will be False.
result.message will contain the exception message.
result.result will be an empty list.
Retrieves all filters in a Revit model and stores them in a dictionary.
doc (Autodesk.Revit.DB.Document) – The current model document.
A dictionary containing the filters in the model as RevitFilterOverride objects. The keys of the dictionary are the filter names.
{str: RevitFilterOverride
}
Populates the filter_override and is_filter_visible and is_filter_enabled field of a ‘RevitFilterOverride’ instance based on the view past in.
view (Autodesk.Revit.DB.View) – The view from which the filter override is to be used.
filter_storage_instance (RevitFilterOverride
) – An instances of revit filter storage containing no view specific information.
An updated instances of revit filter storage now containing the override, filter visibility and filter enabled flags.
Populates the category_override and is_category_hidden fields of a list of ‘category_storage’ instances based on the view past in.
view (Autodesk.Revit.DB.View) – The view from which the category override is to be used.
filter_storage_instances ([RevitFilterOverride
]) – A list of instances of class ‘RevitFilterOverride’
A list of instances of class ‘RevitFilterOverride’ where the override, filter visibility and filter enabled flags have been updated dependent on the view.
Applies filter override(s) to a single view
doc (Autodesk.Revit.DB.Document) – The current model document.
view (Autodesk.Revit.DB.View) – The view on which the category override is to be used.
filter_storage_instances ([RevitFilterOverride
]) – A list of storage class instances.
Result class instance.
Apply override status returned in result.status. False if an exception occurred, otherwise True.
result.message will contain message ‘Successfully set category override…’ for each override applied.
result.result will be an empty list
On exception:
result.status (bool) will be False.
result.message will contain the exception message.
result.result will be an empty list.
Checks if a specific filter is applied to a given view.
view (Autodesk.Revit.DB.View) – The view object to check for applied filters.
filter_to_check_id (Autodesk.Revit.DB.ElementId) – The ID of the filter to check if it is applied.
A boolean value indicating whether the specified filter is applied to the view.
bool
Adds a filter to a view in Autodesk Revit.
doc (Autodesk.Revit.DB.Document) – The current model document in Autodesk Revit.
filter (Autodesk.Revit.DB.ParameterFilterElement) – The filter to be added to the view.
view (Autodesk.Revit.DB.View) – The view to which the filter will be added.
An instance of the Result class that contains the result of the filter addition. The result attribute is True if the filter was added successfully, otherwise False. The message attribute contains additional information about the result.
Removes a filter from a view.
doc (Autodesk.Revit.DB.Document) – Current Revit model document.
filter (Autodesk.Revit.DB.ParameterFilterElement) – The filter to be removed from the view.
view (Autodesk.Revit.DB.View) – The view (can be a view template too!)
Result class instance.
.result True if filter was removed successfully or if filter was not applied or if view does not support filters, otherwise False
.message will contain deletion status.
. result (empty list)
on exception:
.result Will be False
.message will contain exception message.
. result (empty list)