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: 

Get answer from a messagebox - external rule

1 REPLY 1
SOLVED
Reply
Message 1 of 2
tuliobarata
415 Views, 1 Reply

Get answer from a messagebox - external rule

Hi all again,

 

In that NOTES form that im creating, in some part i ask to the user if he wants  to erase all the data from the textboxes, using this code.

But i have 2 problems.

with buttons OK and cancel or Yes and NO, if I click in any button, the  rule runs... how could i get the users answer and run this rule just if the user choose YES or OK ?

 

And to erase the parameters, it takes +- 4seconds, i guess its too long! Why is that ? how could I improve this time ?

 

 obs, im using this code inside a EXTERNAL RULE thats called in a GLOBAL FORM.

 

 

 

i = MessageBox.Show("Desenja mesmo apagar as notas ?" & vbCrLf & vbCrLf & "Obs.: Caso a opção ""0 - Notas em branco"" NÂO esteja" & vbCrLf & "selecionada, as notas típicas serão mantidas!" , "Confirmação:",MessageBoxButtons.OKCancel,MessageBoxIcon.Exclamation)

If Not i Then
Parameter("Nota1_ID1") = ""
Parameter("Nota2_ID1") = ""
Parameter("Nota3_ID1") = ""
Parameter("Nota4_ID1") = ""
Parameter("Nota5_ID1") = ""
Parameter("Nota6_ID1") = ""
Parameter("Nota7_ID1") = ""
Parameter("Nota8_ID1") = ""
Parameter("Nota9_ID1") = ""
Parameter("Nota10_ID1") = ""
Parameter("Nota11_ID1") = ""
Parameter("Nota12_ID1") = ""

Parameter("Nota1_ID2") = ""
Parameter("Nota2_ID2") = ""
Parameter("Nota3_ID2") = ""
Parameter("Nota4_ID2") = ""
Parameter("Nota5_ID2") = ""
Parameter("Nota6_ID2") = ""
Parameter("Nota7_ID2") = ""
Parameter("Nota8_ID2") = ""
Parameter("Nota9_ID2") = ""
Parameter("Nota10_ID2") = ""
Parameter("Nota11_ID2") = ""
Parameter("Nota12_ID2") = ""

End If

 

 

Thanks again!

 

Túlio Barata

 

 

IV 2013
1 REPLY 1
Message 2 of 2

Hi,

 

ilogic is based on VB.NET. So you can get the enum of MessageBox.Show in MSDN:

 

 // Summary:
    //     Specifies identifiers to indicate the return value of a dialog box.
    [ComVisible(true)]
    public enum DialogResult
    {
        // Summary:
        //     Nothing is returned from the dialog box. This means that the modal dialog
        //     continues running.
        None = 0,
        //
        // Summary:
        //     The dialog box return value is OK (usually sent from a button labeled OK).
        OK = 1,
        //
        // Summary:
        //     The dialog box return value is Cancel (usually sent from a button labeled
        //     Cancel).
        Cancel = 2,
        //
        // Summary:
        //     The dialog box return value is Abort (usually sent from a button labeled
        //     Abort).
        Abort = 3,
        //
        // Summary:
        //     The dialog box return value is Retry (usually sent from a button labeled
        //     Retry).
        Retry = 4,
        //
        // Summary:
        //     The dialog box return value is Ignore (usually sent from a button labeled
        //     Ignore).
        Ignore = 5,
        //
        // Summary:
        //     The dialog box return value is Yes (usually sent from a button labeled Yes).
        Yes = 6,
        //
        // Summary:
        //     The dialog box return value is No (usually sent from a button labeled No).
        No = 7,
    }

  so, in this case you can know  i = 1 means the user clicks OK.

 

As to performance issue, without a sample, it is hard to give a comment. You will need to provide a reproducible demo.

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

Post to forums  

Autodesk Design & Make Report