Rule for Value Pass in increment of 10 in Text Box

Rule for Value Pass in increment of 10 in Text Box

Pratik.Ksoni
Advocate Advocate
262 Views
1 Reply
Message 1 of 2

Rule for Value Pass in increment of 10 in Text Box

Pratik.Ksoni
Advocate
Advocate

Hello,

 

could you please guide me how to pass value in increment of 10 in text box?

for example one can not add 15 in text box if add then message should pop-up and can add like 10,20,30,40 and so on.

 

Thanks
Pratik

0 Likes
263 Views
1 Reply
Reply (1)
Message 2 of 2

pball
Mentor
Mentor

I have two examples for you.

 

Prompt for a number, then check if it's a multiple of 10, if not repeat until valid entry is entered or prompt is canceled.

 

start:
myparam = InputBox("Please enter a multiple of 10", "Enter a Number", "10")
If (myparam = "") Then
	'canceled
Else If (myparam Mod 10 <> 0) Then
	Goto start
Else
        'do stuff here
	Parameter("d2") = myparam
	ThisDoc.Document.update
End If

 

If you only need values up to a certain point this is another method. This requires making a multivalue parameter named Numbers in this case with all the valid values you want to allow.

 

myparam = InputListBox("Prompt", MultiValue.List("Numbers"), Numbers, Title := "Choose a Value", ListName := "Choose a Number")
If (myparam = "") Then Exit Sub
'do stuff here
Parameter("d2") = myparam
ThisDoc.Document.update

 

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style