Hi, nice to see you on my page. If you are looking for tools that will help you in the daily work of an architect, engineer or designer, you have come to the right place. Below are the latest entries. If you are looking for something specific, you can do so using the search engine or post categories. If you want to know more about me, please visit the "about me" tab. Have you used my solutions? You can return the favour by buy me a virtual coffee using the "Buy me a coffe" button
Hi, nice to see you on my page. If you are looking for tools that will help you in the daily work of an architect, engineer or designer, you have come to the right place. Below are the latest entries. If you are looking for something specific, you can do so using the search engine or post categories. If you want to know more about me, please visit the "about me" tab. Have you used my solutions? You can return the favour by buy me a virtual coffee using the "Buy me a coffe" button
With this feature, you won’t have to set the same filter overrides for multiple views. Just create a set on one of the views and then just copy the filters.
Revit copying filters – assumptions of the program
The revit copy filters feature simplifies the process of creating views in the model. Thanks to it, it is not necessary to create the same filters for each view. Just copy them. You will find this feature useful:
You will set the appropriate views in the model
You prepare drawings for printing on a complex model
During the project, there is a need to create specific filters
Instruction how to install my extension you can find here.
Program in action
First, the program downloads a list of filters in the opened view, and then displays the possible variants. It is possible to select several revit filters at once!
Next, we go to the view selection window to which we want to copy our filter settings. Multiple views are also available here.
After clicking the confirm button, the program overwrites the filters and then returns us a list of transferred filters. Thanks to this, we can make sure that everything went as planned.
Film with instruction of use
Source code – Revit copy filters
Below is the program code from the first version of the overlay. For more please visit mine GitHub, where new versions of the overlay will appear on a regular basis.
Python
Copyright(C)2022 Paweł Kińczykfrom rpw import revit as rvfrom Autodesk.Revit.UI.Selection import*from Autodesk.Revit.DB import*from pyrevit import formsfrom pyrevit import outputdoc = rv.docuidoc = rv.uidocclassView_copy:def__init__(self):## Get active viewself.views_to_paste =[]self.active_view = doc.ActiveView## Get active view filters filters =[doc.GetElement(i)for i inself.active_view.GetFilters()]self.filter_dict ={x.Name : x for x in filters} views =FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Views).WhereElementIsNotElementType().ToElements() views_template =[]for view in views:if view.IsTemplate ==True: views_template.append(view)self.views_dict ={Element.Name.GetValue(x): x for x in views_template}## Pick filters you want to copyself.selected_option_a = forms.SelectFromList.show(self.filter_dict.keys(),title="Select filters in active view",multiselect=True,button_name='Select filters to copy')self.selected_option_b = forms.SelectFromList.show(self.views_dict.keys(),title="Select views where you want to past filters",multiselect=True,button_name='Select views to past filters')## Set filters to new view filters_overr =[] filters_overr_id =[] transaction =Transaction(doc,'Add insulation - PYLAB') transaction.Start()try:forfilterinself.selected_option_a: f =self.filter_dict[filter] filter_id = f.Id filters_overr.append(self.active_view.GetFilterOverrides(filter_id)) filters_overr_id.append(filter_id)for view inself.selected_option_b:for filter_overr_id, filter_overr inzip(filters_overr_id, filters_overr):self.views_dict[view].SetFilterOverrides(filter_overr_id, filter_overr)print("View: "+str(view)+" <- Filter: "+str(doc.GetElement(filter_overr_id).Name))exceptTypeErroras e:print("Error: \n You didn't pick any view or filter")exceptExceptionas e:print("Error:")print(e) transaction.Commit()output = output.get_output()output.print_html('<font size="6"><strong>Results:</strong></font>')a =View_copy()
Please report any irregularities in the operation of the program that occur during use on my social accounts or account GitHub.