Is there a plan to add Ctrl + C or something so I can break out of my code without Dyno and Revit crashing every time I use a while loop but forget to add a count?
Please say yes!
Is there a plan to add Ctrl + C or something so I can break out of my code without Dyno and Revit crashing every time I use a while loop but forget to add a count?
Please say yes!
No⦠consider it punishment for forgetting to add the break clause!
haha! Noooooooo
No fair!!!
/me sulks
Weāve all been there before. I have a tab in notepad++ always open and a counter based while loop is one of many starters in it. Suggest building an onhand reference like this, saves me much time.
Typically I find that if I need a while loop, Iām likely doing it wrong.
For loop? Often.
List comprehension? No worries.
While loop? May not be the best way to go about what Iām after, so confirm itās a necessary effort.
Still need that while loop? Save often, build the āstopā clause first, and expand from there.
Also well placed continues and breaks within the loop can also make your overall code more efficient as well as an exit on fail.
Haha, thanks⦠Not helpful
Sometimes I want a while loop⦠They exist for a reason no?
Gimme a break
I want that break⦠even more than I want autodesk to sort out the broken date format
Yep but I mean hitting the ⦠get me out of here ⦠key when Iāve messed up my code and itās gone into an infinite loop.
Oh, the āget me out of hereā key! You should have said so earlier⦠Looks something like this ( design and location varies per device model though) ā¦
Unfortunately thatās true⦠But I want, nay demand a more user friendly one
I still think that should be marked as the solution⦠It is technically what you wanted!
hahaha!!! Am actually laughing!
One other thing I have used in some scripts recently is nodes to basically send all or nothing, I call them Resistors but there is probably a formal name for this process (gates?).
They warn a user if they are about to send more than a certain number of objects into a script and give you the option to send nothing if you hit cancel. Might help in some cases, hereās a rudimentary example using Python, I use them in pyRevit typically to terminate script runs if users run a script that has the potential to get way too many objects.
Resistor.dyn (8.5 KB)