• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Inventor

    Reply
    Distinguished Contributor
    Posts: 204
    Registered: ‎03-04-2009
    Accepted Solution

    iLogic. Define next action based on OK or Cancel Button from Message Box

    389 Views, 1 Replies
    03-15-2011 02:23 AM

    Hi I have created a size rule which first fires a warning message with an option of selecting ok or cancel.

     

    I would like the ok option to then set the model to the min allowable value as specified in my code, however, if the user chooses Cancel that portion of the rule must not run and the size parameter which was changed resulting in the firing of the messagebox should be set back to what it was.

     

    Thanks

     

    If TEDCD - 7 < TECID Then
    MessageBox.Show("Endcap and Energy Diffuser Ring DS8 non-conformance. Select OK to automatically reset the Energy Diffuser Ring Ø to the minimum allowable value or CANCEL to go back and select a smaller Endcap ID.", "Energy Diffuser Ring Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1)
    End If

    If TEDCD - 7 < TECID Then
    TEDCD = TECID + 7
    End If
    Please use plain text.
    *Expert Elite*
    Curtis_Waguespack
    Posts: 1,988
    Registered: ‎03-08-2006

    Re: iLogic. Define next action based on OK or Cancel Button from Message Box

    03-15-2011 07:43 AM in reply to: wseaston

    Hi wseaston,

     

    You might consider using a Yes/No message to gather an answer from the user, rather than the default OK/Cancel message. If you combine this with a variable to capture the current state of the parameter, before the user changes it, then you can recall that value to use later in the rule if the user choose the No option.

     

    I've provided a sample rule here:

    http://inventortrenches.blogspot.com/2011/03/using-yes-no-message-box-in-your-ilogic.html

     

    This is just one approach, but I think the use of Yes/No buttons will help you with this rule.

     

    Best of luck to you in all of your iLogic and Inventor pursuits,

    Curtis

    http://inventortrenches.blogspot.com/



      solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.

    Please use plain text.