Are there methods to answer dialog boxes or bypass them when running batch scripts?

I am trying to process batches of REVIT project files for various operations. Are there any methods that people have used to bypass or even suppress the message boxes that tend to pop up and interrupt the script from completing? i.e. coordination alerts on copy monitor messages or space is not a properly enclosed region…etc
What’s the point of trying to run batch if we have to sit there and address every message box that pops up?

oh dear god…That is Way above my pay grade! I wouldn’t even know where to start…
And on top of everything else discussed he has lines of codes in Spanish…
// Buscamos el botón de aceptar y lo pulsamos.
int ID_OK = 1;
IntPtr hwndOk = Win32.Functions.GetDlgItem(
hwnd, ID_OK );

So is the short answer “No” ?

1 Like

It would be very difficult to do it in Dynamo, if not impossible due to the state in which Dynamo run internally to Revit, but there are method, as shown, that are able to do what you are looking for.

@Dave_Vaughn Check out this article by @Konrad_K_Sobon:

3 Likes

Thanks to both of you for the information!
I am not a programmer using any languages i.e. VBS or C#.
How would this be used with a Dynamo program that is written to operate on a batch of project files that is using the windows task scheduler for frequent processing? It’s not like Python, that could be used within the Dynamo script.

@Dave_Vaughn as @SeanP has said, it’s not impossible but certainly not easily achieved in Dynamo, and certainly not without some programming skills - even in Dynamo. I think that you can make Dynamo execute Win32 APIs, and latch onto events, but it would require writing a Dynamo plugin/view extension so that you hook into events in Revit. I am not sure it’s worth the effort. It would have been much easier achieved via a Revit plugin. The same thing in Revit can be done relatively easy, or at least using methods that were designed to achieve this, as opposed to some nasty hacks in Dynamo. I am sorry to break this to you, but Dynamo as great as it is, it has its limitations and I almost never recommend it as the go to process for production workflows. It’s a great experimentation environment.

Anyways, long story short. It’s possible, but easier done in Revit as a plugin. Also, yes, it would require programming, so you might have to consider hiring someone to help you out with this task if its time sensitive, otherwise, keep this thread open, be patient and have hope someone puts the time in to provide a Dynamo solution for the wider community.

Cheers!

4 Likes

Thanks for your insight Konrad!

I was using th custom package node of Springs to copy elements from links into the active project and a warning window appears for every element to copy indicating the element is defined already in the project but do you want to overwrite or cancel? the trick was to press button enter with a stone more than one hour

I think the problem here is that the node probably isn’t grouping items together, but copying them one at a time. If you grouped all items from one doc, then you’d at least only have to press it once per document.