Forgot password?

Create an account!


« back

RhinoScript – Cancel button on Rhino.EditBox


Please log in to write a message.

  • 2. pulgarata (Mar 03, 2016 13.01):

    When you press the cancel button the editbox function return "Null".
    To detect "Null" you can use IsNull(), this return True or False.
    To exit of the script, you have to exit of the function or subfunction first.
    I write that in this way:

    Sub Main()
            Dim Dialogue
            Dialogue = rhino.editbox(, "Enter Dialogue")
            If isNull(Dialogue) Then
                    rhino.print "Cancelled"
                    Exit Sub
                    rhino.print dialogue
            End If
    End Sub
  • 1. TMBRhino (Mar 01, 2016 17.30):

    I am still fairly new to rhino script but im trying to exit a script when the cancel button is pressed on a "rhino.editbox" as in my current script the cancel button just closes the dialogue box and continues the script (i have multiple "edit boxes" so it gets annoying trying to quit).
    im trying to use something like:

    Dim Dialogue
    Dialogue=rhino.editbox(,"Enter Dialogue")
    If Dialogue="" then
    rhino.print "Cancelled"
    rhino.print dialogue

    But this isnt working, ive also tried dialogue=nothing, dialogue=empty etc but nothing seems to work.
    Thanks for any help you can offer.


Why are these buttons gray?