Limit the string input in Dynamo

Hi,
I was wondering if there is a way to limit the number of characters a string can hold in Dynamo. Basically, I have set one string code to ‘is input’ and want it to take only three character input. No more - no less! So after setting the node to ‘is input’ the user should be able to input only three characters (max.).

1 Like

@H.S , hi

you can count the length of the string, and filter.
grafik

KR

Andreas

1 Like

@Draxl_Andreas Thank you for your advice. I have placed the logic. I have also found a way to not let user enter more character in the string than limit defined in the Python code using .Net API browser. (TextBox.MaxLength Property (System.Windows.Controls) | Microsoft Learn)

2 Likes

Very interesting @H.S

Could you perhaps share a script & video/ screenshot where you got this to work? (Or a sample)

1 Like

Thank you Daan for your query. Data-Shapes’ Multiple Input Form can be used to do it. It is wonderful and does generate a dialog box. There is just the addition of ‘Max Length’ property in the Multiple Input Form like below:

image

This can also be done without Data-Shapes Multiple Input Form using dot net framework with python to create a user interface (or the dialog box). All the details are present at the dot net website. Main links are as follows:

1 Like