Create Custom UI with rpw.FlexForm

rpw module is included in pyRevit by Default!

# 🔷 rpw.FlexForm
from rpw.ui.forms import *

# Define UI Components
components = [Label("Text Value 1:"), TextBox('text_1', Text="Text 1"),
              Label('Text Value 2:'), TextBox('text_2', Text="Text 2"),
              Separator(),
              Label('Min Value(in cm):'), TextBox('_min', Text="40"),
              Label('Max Value(in cm):'), TextBox('_max', Text="250"),
              Label('Step Value(in cm):'), TextBox('_step', Text="10"),
              Separator(),
              Button('Select')]

# Create UI Form + Show it
form = FlexForm(__title__, components)
form.show()

# Get All Values (as dict)
values = form.values

# Read Values
text_1  = values['text_1']
text_2  = values['text_2']
_min        = float(values['_min'])
_max        = float(values['_max'])
_step       = float(values['_step'])

⌨️ Happy Coding!
Erik Frits