Pause script for manual interaction in Revit

Can a Dynamo script be paused, to allow for some manual interaction within the Revit program, and then have the script resume?

Hi @JustinStirling,

What exactly are you trying to do? And do you really need the user to interact with revit? Generally I avoid any user interaction unless it is to select an element or to set values for the script in a UI or in graph. Relying on a user to do exactly what you want is a bit of a leap of faith where it could go wrong if the user doesn’t understand what they need to do and do the wrong thing or simply make a mistake.

Having said all that, one potential solution is you could just use a boolean node coupled with an if node in your graph where the true input would be the data you want to pass along and false input be a null (you would place this at the point you want the graph to pause). By default the bool would be set to false so on first run all data would get blocked at the if node and a null passed on (probably throwing a whole load of yellow warnings), then user can do their thing and hit true on the boolean node and run again and the other blocked data can then flow forwards to the rest of the graph. You could also use data-shapes to create a UI to do something similar and might be more obvious to the user what to do as you could add instructions. However, I can think of a few instances this might not be desirable, depends on what you’re trying to do.



@Daniel_Woodcock1, thank you for the response and sorry for the delay with me getting back to you.

Here’s what I’m trying to do. I’m creating a script to automate the creation of an MEP model, with a structural/architectural model as a link. Throughout the process of the running script, or even at the very end of the script, I’d like the user to be forced to “monitor” the levels that were copied.

Right now I just have a little warning message popup, but that doesn’t mean that someone will actually take action on that message.

Do you think this is possible with what you outlined above or by some other means?

No worries @JustinStirling

Yes, the above method using data|shapes should still work. You just need to put a clockwork passthrough node before the data|shapes node. The pass through node block blocks data until it is triggered. The trigger will be whatever data in your graph at the point you want the UI to pop up, the data you will pass through is just a boolean set to true. This then feeds into the data|shapes node at the port named toggle. So, as soon as the trigger data reaches the pass through node it will return True which in turn will pass to the data|shapes node and run that. You can use revit while this data|shapes UI is active. However, this doesn’t mean the user cant just skip the message and move on.You could do some post UI validation by checking whether the elements are indeed monitoring and if they are not then throw a warning.

Hope that is clear enough! :blush:


Having a tough time visualizing it exactly, but I’ll give it a try and see if I can get something to work. Thank you for the advice!

Worked like a charm @Daniel_Woodcock1 ! Thank you very much!

1 Like

As a follow-on, I was able to open a specific view to perform the requested action on by using a method identified by @Nick_Boyts in Call View to Open.