Inventor Customization

Inventor Customization

Reply
Mentor
tuliobarata
Posts: 164
Registered: ‎11-30-2007
Message 1 of 2 (230 Views)
Accepted Solution

Get answer from a messagebox - external rule

230 Views, 1 Replies
11-01-2012 11:02 AM

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

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.

ADN Support Specialist
xiaodong.liang
Posts: 1,302
Registered: ‎06-12-2011
Message 2 of 2 (204 Views)

Re: Get answer from a messagebox - external rule

11-19-2012 10:35 PM in reply to: tuliobarata

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.



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.