Inventor Customization

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

Get answer from a messagebox - external rule

206 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
ADN Support Specialist
xiaodong.liang
Posts: 1,190
Registered: ‎06-12-2011
Message 2 of 2 (180 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube