iLogic link between MessageBox Yesbutton and InputBox

iLogic link between MessageBox Yesbutton and InputBox

BRLMCHKD
Advocate Advocate
2,269 Views
9 Replies
Message 1 of 10

iLogic link between MessageBox Yesbutton and InputBox

BRLMCHKD
Advocate
Advocate

Hi Inventor Forum

 

I'm struggling with a problem in iLogic.

 

Want's to make a link between the 'Yes button' in MessageBox to activate InputBox

(to enter value that controls my relevant parameter) . . . See my attachment.

 

But I can't find the information how to write the code

 

Is anyone here that could provide me some ideas? 🙂

 

Thanks.

BRL

 

 Link MessageBox to InputBox.jpg

kelly.young has embedded your image for clarity.

0 Likes
Accepted solutions (1)
2,270 Views
9 Replies
Replies (9)
Message 2 of 10

Thomas_Savage
Advisor
Advisor

Hello @BRLMCHKD

 

Have you tried the input box? I have attached a screenshot to show you which one i mean.

 

Place you parameter you want changing, then prompt, title, default entry.

 

Is this what you wanted??

 

Thomas.

 

 

input box.png



Thomas Savage

Design Engineer


Message 3 of 10

BRLMCHKD
Advocate
Advocate

Hi Thomas.

 

Thank you very much for your answer 🙂

But I still not know how to activate the InputBox automatically based on the answer (Yes) given in the message box.
E.g. : When I answer yes, I would like that to automatically activate the InputBox to pop-up next.
I need a programming example how to write this code to give that link from MessageBox to InputBox.

Hope you understand my question/problem 🙂

KR

Bent

0 Likes
Message 4 of 10

Thomas_Savage
Advisor
Advisor

Would it be possible to attach your .ipt?

 

Thomas.



Thomas Savage

Design Engineer


0 Likes
Message 5 of 10

BRLMCHKD
Advocate
Advocate

Hi Thomas.

I have tried to attach my ipt, hope this will do 🙂

I'm going on weekend now.

Have a nice weekend.

0 Likes
Message 6 of 10

mcgyvr
Consultant
Consultant

 

Answer = MessageBox.Show("Would you like to input a value ", "Question?", MessageBoxButtons.YesNo)
        If Answer = vbYes Then
			myparam = InputBox("Enter the Value", "Value Entry", "10")
			MessageBox.Show ("Value = " & myparam, "The value I entered")
            Return
		ElseIf Answer = vbNo Then
			MessageBox.Show ("You did not want to enter a value", "No Answer")
        End If

@BRLMCHKD  Code above..



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 7 of 10

Thomas_Savage
Advisor
Advisor

Good code @mcgyvr

 

I had this:

 

SyntaxEditor Code Snippet

If MessageBox.Show("Message", "Title",MessageBoxButtons.YesNo) = vbYes Then

Width = InputBox("Prompt", "Title", "Default Entry")

End If

Thomas. 



Thomas Savage

Design Engineer


Message 8 of 10

mcgyvr
Consultant
Consultant

@Thomas_Savage wrote:

Good code @mcgyvr

 

I had this:

 

SyntaxEditor Code Snippet

If MessageBox.Show("Message", "Title",MessageBoxButtons.YesNo) = vbYes Then

Width = InputBox("Prompt", "Title", "Default Entry")

End If

Thomas. 


@Thomas_Savage Yeah I just made the "long hand" version I guess which to me is always helpful to those still learning (which includes myself)..

 

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 9 of 10

Thomas_Savage
Advisor
Advisor
Accepted solution

Yes it is helpful @mcgyvr

I am still learning iLogic as well.

 

Thomas.



Thomas Savage

Design Engineer


0 Likes
Message 10 of 10

Kay_Rethmeier
Advocate
Advocate

Hi,
there is not a big problem, if you need to check an inputbox with entered text (string). It's more tricky to ask for the cancel button, if your inputbox is used for integer values. Thats possible with a try...catch statement. Here is an example:

 

Dim myStringparam As String = InputBox("String", "Title", "Default Entry")
If myStringparam = "" Then Exit Sub
	
Dim myIntegerparam As Integer = InputBox("Check it out and enter nothing", "Title", 123)
'If myIntegerparam = "" Then Exit Sub ' This will cause a problem, "converting string in double..."



Try 
	Dim myIntegerparam2 As Integer = InputBox("Integer", "Title", 456)
	MsgBox("You entered as string: " & myStringparam & vbCr & "You entered as integer: " & myIntegerparam2)
Catch
	MsgBox("You entered nothing, a not guilty value or a canceled the messagebox")
End Try

 


Bye
Kay

Cheers
Kay (Principal CAD-Consultant)
0 Likes