Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Correct input in message box to get passed message box

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
will_roe
408 Views, 4 Replies

Correct input in message box to get passed message box

Hi,

 

So I put together the below after I needed to defer updates on a drawing and didn't trust my colleagues to update the drawing - they actually have to read the box to get past it. It works fine, but I would like to make it so that it accepts multiple inputs (OK and Ok). I tried a few things but embarrassingly couldn't seem to get it to work.

 

Also if there is a better way of doing this feel free to let me know.

 

Do

accept = InputBox("Drawing updates deferred - Do NOT Update drawing. Type ok (lower case) if you understand to continue", "Drawing Deferred", "Type here")

If TypeName(accept) = "Boolean" Then Exit Sub

Loop While accept <> "ok"

 

Cheers,

 

Will

4 REPLIES 4
Message 2 of 5
Ralf_Krieg
in reply to: will_roe

Hello

 

Can you try

Loop While accept.ToUpper <> "OK"

R. Krieg
RKW Solutions GmbH
www.rkw-solutions.com
Message 3 of 5
Ralf_Krieg
in reply to: will_roe

Sorry, tested last suggestion - doesn't work.

This one should do.

 

Do

accept = InputBox("Drawing updates deferred - Do NOT Update drawing. Type ok (lower case) if you understand to continue", "Drawing Deferred", "Type here").ToUpper 

If accept="" Then Exit Sub 'empty string in input field OR CANCEL BUTTON PRESSED
If TypeName(accept) = "Boolean" Then Exit Sub

Loop While accept <> "OK"

 


R. Krieg
RKW Solutions GmbH
www.rkw-solutions.com
Message 4 of 5
WCrihfield
in reply to: will_roe

Here's another idea.  You don't have to worry about spelling, capitalization, Cancel, or Esc key use this way.  They must deal with it by choosing one of the available options, before it will let the user move on.

Dim oOptions As New List(Of String)
oOptions.AddRange({"OK", "CANCEL" })
ReShow :
oAns = InputListBox("Drawing updates deferred - Do NOT Update drawing.", oOptions,"","Drawing Deferred")
If oAns = "" Then
	GoTo ReShow 'so they can't get out of dealing with it, and shoosing an answer.
End If

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb:or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 5 of 5
will_roe
in reply to: Ralf_Krieg

Thanks,

 

I'm not sure how I missed originally but you can just press the x and the box goes away. Any idea how to stop this?

 

edit:

 

Sorted it -

 

Do

accept = InputBox("Drawing updates defered - Do NOT Update drawing. Type ok (lower case) if you understand to continue - WR and JF", "Drawing Defered", "Type here")

acceptupper = accept.ToUpper

If TypeName(accept) = "Boolean" Then Exit Sub

Loop While acceptupper <> "OK"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report