Hi everyone. I’m new at Python and pyRevit. I used to write macros for Revit using C#. I would like to know how do I have to do if, in a the midle of the script, I want to cancel the scrip because something it’s not the way it was expected. In C# I would do this with de Result.Cancelled command.
Thanks!
Hi, I guess enclosing your command in a try: … except:… would do.
https://docs.python.org/3/tutorial/errors.html#handling-exceptions
you could find a few example in pyrevit documentation
https://pyrevit1.readthedocs.io/en/latest/pyrevit/init.html#implementation
or in the pyrevit code base as well