简体   繁体   中英

How to take user input using PyRevit?

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.

使用.NET Windows.Forms库,并使用ShowDialog在模式Windows窗体中显示输入提示。

There ia 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM