eivhal
(Eivind)
1
I am trying to take template as user input by pyrevit forms, but I want to filter by viewtype. For instance only show templates of type Floor Plan.
I’ve tried looking for explanation/examples of uses of the filterfunc= argument for forms.select_views but all examples show filterfunc=None.
How can I found out how to apply the correct value of filterfunc to get desired results?
Jean-Marc
(Jean-Marc Couffin)
2
@eivhal Welcome!
plenty of examples in the github repo
selected_views = forms.select_views(filterfunc=lambda x: isinstance(x, DB.ViewPlan), use_selection=True)
The new search function in Github is invaluable for that matter.
using this:
you get this:
eivhal
(Eivind)
3
Great!
This was exactly the response I was hoping for.
I knew I had seen something like this in the pyRevit scripts, but Couldn’t find it.
Now i know how to search for the good stuff 
Jean-Marc
(Jean-Marc Couffin)
4
another way to search that I like is using notepad++
CTRL + F then

eivhal
(Eivind)
5
Nice! I never knew about this function.