0

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 2

1

Use the .NET Windows.Forms library and display a prompt for input in a modal Windows form using ShowDialog.

1
  • Tkinter or wxPython would remove the need for .NET installed. If you compile the your python-script the user also don't need Python.
    – Punnerud
    Feb 21, 2019 at 7:02
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.