Searching for specific text within all schedule views

Hello All,

As Revit seems unable to search for text within schedules i am trying to write a dynamo workflow that does!

This is my current dynamo workflow:
Schedule Text Search.dyn (30.8 KB)

Screenshot:

Currently the workflow gathers all schedules, then filters by view template and also by various characters that i know relate to schedules i don’t need to gather.

I’m then left with a small list of filtered schedules that i want to search for specific text.

I have used the “Schedule.GetData” node from BimorphNodes Package to gather all data within each of my schedule view.

Then i have identified the indices of the lists containing the text.

My problem is how do i then filter the small list of schedules to find out exactly which schedule view the text was found on?

The list.AnyTrue node looks at Level 2 so returns (in my case) 254 results so i can’t use that to filter (by boolmask) the smaller list (34 items) of schedule views.

Also, as a little bonus question…
Rather than having 3 filter groups near the beginning of the workflow that searches for “*”, “.” and “_”, can i filter the list by all 3 at the same time? ie. if the string/‘schedule view’ name contains any of the following characters?

Many thanks in advance for any help.

I will update if i progress any further.

Also it seems no-one has asked about searching for text within schedules before, unless the forum search has failed me. So hopefully this workflow can help others (when finalised). Please be aware that without filtering your list of all schedules in the project file this workflow can take a long time to run / can crash (talking from experience). This is why i have filtered firstly by view template as it reduce the number of schedules significantly. Obviously each project file will be different and not everyone will use view templates as i do but just something to be aware of.

Thanks!
Jack.

A couple of options here…

conditional.dyn (27.4 KB)

This will test each view against all strings you feed into the searchFor input. The key here is to use cross-product lacing so that each view is tested against each and every string. Then using List.AllTrue @L2 you will return a list of bools that are only true if all of the test values are present in each of your views.

The same done in Python:

views = IN[0]
tests = IN[1:] # All other inputs used to test against

OUT = [all(test in view for test in tests) for view in views]
"""
# Equivalent to the following:
bool_out = []
for view in views:
	bool_temp = []
	for test in tests:
		bool_temp.append(test in view)
	bool_out.append(all(bool_temp))
OUT = bool_out
"""

EDIT: This can easily be changed to return all lists where any value is true. In the OOTB version, change List.AllTrue to List.AnyTrue and in Python change “all” to “any”.

1 Like

Hi @cgartland,

Many thanks for your informative response!

Unfortunately your dyn file seems to be corrupt for me but i have managed to replicate your results and have applied it to my workflow without issues (just had to pass the view elements list into a “element.name” node as “string.contains” of course doesn’t accept elements as direct inputs)

As this was the “bonus question” i won’t be marking it as the solution to the main issue BUT again thanks very much for the clear solutions!

Jack.

1 Like

list_compareAndMatch .dyf (23.4 KB)

This node should do the trick for your filtering needs.
I published this node last summer. It is a super-tool for list filtering.
I am publishing a package full of “List Magic Nodes” for filtering and selecting dynamically next week!

Little Update,

I have reduced the amount of nodes used to filter out unwanted schedules to speed the search up.
@EmmettC Many thanks for your input, i haven’t had chance to give your node a try yet but i will do!

This is my current workflow:
(Note at the moment i’ve included both of the methods provided by @cgartland so i’ll be taking one group of the filter nodes out):
TextSearch2

Still struggling to figure out how use the schedule data output / bool masks to filter the original list of 34 schedules. Maybe there’s a much easier way of searching through the data within each of the filtered schedule views and then applying the list.filterbyboolmask node!

Will hopefully have a little extra time tomorrow to keep working at it!

Any help in the meantime would as always be greatly appreciated.

Thanks,
Jack.

why is it showing as corrupted? is it because i am running a lower dynamo version? am using 1.3

yes. you can download it from the packages for 1.3 just search for Connected_ByDesign.

By some miracle i have managed to produce a solution to my main issue!!

For anyone who would find it useful to be able to search all schedules for specific text i’m happy to share this with you:

Schedule Text Search v5.dyn (34.3 KB)

FYI: I’m using revit 2018.3 + Dynamo 1.3.4
(I would be surprised if there were no issues trying to run this on Dynamo 2.0.2 / Revit 2019)

Screenshot of workflow:

So essentially the only groups of nodes the user needs to look at are the orange groups.

The end output tells you which schedules contain the text you’re looking for + also shows an extract of the schedule where this text is found.

@EmmettC Still haven’t tried your node package as i’m trying to reduce the amount of additional dynamo packages installed as i generally push the useful workflows out to the rest of the team so it saves the hassle of getting them all to install the right packages :slight_smile:

That being said, i’ll still give it a go myself as i’m keen to reduce the size of any workflow to improve efficiency!

Will mark this post as the solution since i’m happy enough with the end result.
That being said, if there are any further improvements anyone thinks i can make then please feel free to point them out.

All the best

Jack.

Edit: Updated to V5 for some additional workflow clarity.

2 Likes

The package I was telling you to get is only that one single node that I published as a placeholder for my complete package which is coming sooooon…
I can send you the 1.3 version… it is powerful list filter…I published that one node and it was featured at Autodesk University by @CStorms Have you Tried These Packages.
It is a combo node of DesignScript and Python so you can re-save it in your company folder and distribute it directly to them… just keep my credits inside the node if you would.[List_CompareAndMatch .dyf (10.6 KB)
](http://)
This should work on 1.3

Good job working through the process! you will be flying with this stuff in no time.

1 Like