Is there a "continuous execute until true" node?

I need something that will force FileSystem.FileExists to continuously ping the path until it sees the file. (I’ve searched without success.)
Once it verifies the file exists, then it will continue.
Any help is appreciated. Thank you!

Why not ask once, and if not create the file; otherwise pass the result?

Maybe you could use a while loop to do this, don’t know if it’s really possible.

@JacobSmall I’m printing PDFs (you can see the Shared section for my DYN file). There’s an issue with merging the final created set of PDFs in that it will often merge before the final PDF is created.

So, if I could simply verify that the final printed PDF exists then it would guarantee that all PDFs would be included during merge.


With PDFs and some other ‘driver’ based files the fact that the file exists is often not enough information, and just because they are sent doesn’t mean they are done (which is your exact issue). To complicate things even further, just because the PDF file exists doesn’t mean it’s done writing to disc. In some cases the driver will actually create the file, open the file, add the content to the file, save the file, and close it. It’s unlikely you’d get this outcome with most drivers for single sheet PDFs, but it’s possible to run into concurrent access issues and other problems all the same. As such it may be best to wait for confirmation from the printer itself, but that’s a difficult task which will vary based on your driver.

Alternatively, you could write the expected list of PDFs to a text file, and run a second graph that reads the path to each of the generated PDFs, and combines them into a single text file. Benefit here would be that you would get consistent results, and you could easily adjust the order and combine PDFs from other sources (ie: the specification, which likely didn’t come from Revit) while you were at it.

1 Like

Not a great method as there is no way to know how long it takes to wright a PDF (depends on content being printed). But you could use pythons sleep function.

import time


OUT = IN[0]

This will pause the script for 10 seconds (my input variable change as needed) and then pass the information input into the node.

The TimeSpan nodes are just to check that it is working. As you can see it took longer than 10 seconds to complete this very simple script.

Again this does not mean that the PDF will be completed after the given sleep time and it could also force you to wait longer as the PDF could complete well before the sleep timer ends.