Ignore or click okay to warnings while opening Revit files in background with Revit

hello,

I have been using python and package nodes as Rhythm open Document in background, and I am annoyed because many times Revit shows me many different types of warning which stop opening the files and I have to respond to the warning to continue the process and finally execute the script.

Here an example of warning, I would like to write python code to say anything appears click okay, wich is a function not included in the packages or python codes used until now but would be great to have it because I feel that using Dynamo is useless if I have to watch constantly the screen from beggining until end.
image

1 Like

Might be time to try pyrevit, it has a class to deal with some of these things. Pyrevit also has entirely exposed python code and libraries if you want to attempt to make it in dynamo.

See the errorswallower class in link below and pyrevit itself. Short of that an autoclicker app might help also.

https://pyrevit.readthedocs.io/en/latest/pyrevit/revit.html

1 Like

Hello @GavinCrump nice swallower, but how can I execute it? do I need to install the plugin in Revit of pyrevit?

It’s made to capture python scripts in pyrevit using a with statement like the example. I haven’t used it yet myself but it appears it’s meant to bypass warnings that might appear in a Revit process.

The functions in pyrevit docs are written in the py files that come with pyrevit which might be recreatable in Dynamo, but can’t be run as they are from within Dynamo as far as I know. It will need some research and work to explore this further.

This swallower is likely derivative of the Revit API class iFailureProcessor and PreProcessor.

Be VERY careful with this; while some warnings can be ignored (ie the room tag one you show) it can be detrimental and even destructive to ignore them all - in fact I have seen a firm lose 6+ months of work because of aggressive suppression. Somewhere a shell shocked intern has carpel tunnel from all the mouse select, ctrl+c, alt+tab, ctrl+v work (when automation breaks things companies tend to not trust automation to fix them).

It is not a tool to implement lightly.

4 Likes

great there is something to do with it but no idea how is that in python code to run in on Dynamo, any suggestion would be very useful. In my case, I just want to open Revit files to check and report but no edition at all on the files opened.

I believe you’d need to run it all in a ‘with’ statement using Python or the zero touch equivalent, dont think dynamo can wait for failures in other nodes as it comes and handle them given it runs with revit sitting idle. Typically these types of barriers are a good indicator it’s time to move beyond noding in my experience, Dynamo can only do so much effectively before flow control and error handling that written languages offer becomes needed.

2 Likes

so forgeting about it because we are not programmers

I am these days, but to each to their own!

1 Like

yep, all the way

3 Likes

Dynamo is not intended as a bulk processor in this way, for the good many reasons you are seeing in this and in some of your other threads @ruben.romero. While you may get somewhere in the short term as you build solutions like this they will not be as stable or quick to process as you want.

And while you may not be a full time developer, the degree of complexity which you’ve already come up against and in many cases resolved means you’re certainly a coder; just because you’re using nodes in Dynamo as your language instead of C# or Python doesn’t mean you couldn’t learn those other languages and begin to use other tools. I have a lot of confidence you could manage it in less time then it’d take you to resolve this issue via nodes alone.

4 Likes