Why does Dynamo not have a break key like a normal programming thingy? ![]()
Can we get one please?!
Why does Dynamo not have a break key like a normal programming thingy? ![]()
Can we get one please?!
Because stopping mid-way though a transaction is a VERY easy way to corrupt a Revit or Civil 3D dataset (or really most CAD applications) for good.
I have filed this under ‘wanted it until I understood the impact’ ages ago.
If you’ve got to shut down the programme and Revit though… Is that any different?
When you hit an infinite loop you have to wait for it to restart and it’s really, really tedious.
Yes, as everything you had changed is lost en-masse. Break would leave things in a modified state without committing them.
An example:
Say you had a graph to move every item in the project by a given vector. You hit run with a vector of (1,0,0) and part way though you decide ‘oh no, I wanted (0,1,0)!’
And so you hit break and things stop. You then change the vector and hit run again. The first half of the project has now been moved by (1,1,0) while the second half has been moved by (0,1,0). Everything is wrong as a result and you curse Dynamo even though it did exactly what you asked. This gets even worse when the action is more involved - stuff like editing a curtain wall causing all the grids + panels to recreate, and stopping midway though means element’s don’t actually exist… there goes all of your dimensions and room boundaries and… it’s bad.
With a ‘force quit’ your changes aren’t committed and Revit has no record of an open transaction, as such life progresses without issue after you restart Revit as you’re starting new.
Alternatively the ‘break’ could act as an instant ‘roll back’, but this actually takes 2x as long as the original action in order to ensure models aren’t corrupted. Plus in the case of your infinite loop you’d just be running infinitely but backwards.
The fix is to just avoid infinite loops by ensuring every loop has a hard out pre-coded. Save the Python, then the Dynamo graph, then type your language of choice’s equivalent of maxCount = 10; while i < maxCount: i+=1;, then hit run to make sure it exits. Then add your real loop and the actions therein, adjusting maxCount as needed.
Dynamo already resets each time you run… So surely that could be encoded in a break?
Also, saying, “write this in” isn’t helpful, sometimes you comment out bits and accidentally comment out the break bits… That’s why every single IDE has a break isn’t it? ![]()
Actually this isn’t the case. Everything is set in the node, and subsequent runs only execute nodes which have upstream changes, the rest is set in memory (which is the other reason break isn’t really doable in visual programming - you’d have to retrieve all the previous data in memory and reset each node).
Not really - you seem to be thinking of it as more of a debugging environment than an execution environment. Also note that the Dynamo Python Editor isn’t intended to be an IDE - you’re comparing sticks to airplanes.
Aeroplanes > sticks. ![]()
Give me a long enough stick and a place to rest it and I can move the world. ![]()
Get me a large enough aeroplane and I can leave the world. ![]()