User input for pipe size

I’m trying to figure out what is the best way to get user input for pipe size. Is the best way to just use 'ask_for_string and try to convert the string into a size?

or select from list with a bunch of options to choose from. probably need to know what you are doing with this input.

if you will have a selection of pipe already and you are trying to filter down to a specific size or something, you could have the select from list only present sizes contained in the selection.

What I do for all thread rod sizes for diameter is use a dictionary to pair the decimal foot value rounded to 4 places with the fractional inch string to retrieve the sizes as well as lookup rows based on the decimal foot value from a spreadsheet without having to deal with math and string conversion and comparison every time. I use the same function in each script to handle the rounding for consistency.

I’m using it to change the size of pipe, fittings, and importantly pipe accessories which usually can’t be changed when all three are selected. I think I might have to ask for a string and convert it or look it up in a dictionary but that could cause issues depending on how the person writes the inputs value.

On the other hand maybe I’ll still go with a list. Then I don’t have to worry about the weird way that one person writes pipe sizes. At that point I’m just worried about the list becoming unwieldly in the menu.

select from list probably easiest. You can display fraction, but have decimal feet in the background and not need to convert each time. picking 1-1/2" from the list would just always provide 0.125’ on the back end

Yeah, I’m trying to figure out if I want to do select from list or use rpw flex form with checkboxes. The list is probably easier but has a drop down which may be annoying. Check boxes come with their own issues. Or maybe I could have multiple buttons? I haven’t used rpw yet so I’m not sure if that is doable.