How would I take user input at various points while running a PyRevit script? I know that input('') doesn't work. I am wanting the user to input integers to perform a calculation.
2 Answers
Use the .NET Windows.Forms
library and display a prompt for input in a modal Windows form using ShowDialog
.
-
Tkinter or wxPython would remove the need for .NET installed. If you compile the your python-script the user also don't need Python.– PunnerudFeb 21, 2019 at 7:02
There i a build in method for this. Example
from rpw.ui.forms import TextInput
value = TextInput('Title', default="3")
print(value)
More examples in the doc: https://revitpythonwrapper.readthedocs.io/en/latest/ui/forms.html