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

    Autodesk Inventor

    Reply
    Contributor
    stracy99
    Posts: 14
    Registered: ‎01-14-2011
    Accepted Solution

    ilogic-how to make an error message using numaric parameter

    156 Views, 2 Replies
    02-18-2013 08:11 AM

    I have a text parameter "ARM_TYPE" that kicks out a numaric parameter "ARM_ANGLE" through an ilogic rule. My problem is i need to have the rule kickout an error when (ARM_TYPE= "none"). I can do this by changing the "ARM_ANGLE" parameter from a Numaric to Text format (see below). The problem here is that "ARM_ANGLE" is used in several more ilogic rule calculations generating other parameter values which also need to kick out an "error"

    I hope this makes sense

     

    Thanks for the help,

    Steve

     

    ilogic error.jpg

     

    If Parameter("ARM_TYPE") = "A995" Then
    Parameter("ARM_ANGLE") = -12
    
    ElseIf Parameter("ARM_TYPE") = "A1023" Then
    Parameter("ARM_ANGLE") = -3.7
    
    ElseIf Parameter("ARM_TYPE") = "A1081" Then
    Parameter("ARM_ANGLE") = -44.1
    
    ElseIf Parameter("ARM_TYPE") = "NONE" Then
    Parameter("ARM_ANGLE") = "####"
    
    End If 

     

    Please use plain text.
    Valued Contributor
    Posts: 58
    Registered: ‎09-13-2012

    Re: ilogic-how to make an error message using numaric parameter

    02-18-2013 12:07 PM in reply to: stracy99

    I hope i understand your question correctly, here is some code you can try.

    I changed your if's to a select case. For me this works easier.

     

    Select Case Parameter("ARM_TYPE")

    Case "A995"
    Parameter("ARM_ANGLE") = -12
    Case "A1023"
    Parameter("ARM_ANGLE") = -3.7
    Case "A1081"
    Parameter("ARM_ANGLE") = -44.1
    Case "NONE"
    'if ARM_TYPE IS NONE then show messagebox with an warning message
    MessageBox.Show("ARM_TYPE = NONE", "Error text",MessageBoxButtons.OK,MessageBoxIcon.Warning)
    'this is some extra code to choose an other arm_length value
    Parameter("ARM_TYPE") = InputListBox("Prompt", MultiValue.List("ARM_TYPE"), Parameter("ARM_TYPE"), Title := "Title", ListName := "List")

    End Select

    If you need more help, let me know.

    Rob.

     

    Autodesk Inventor 2012 Certified Associate & Autodesk Inventor 2012 Certified Professional.
    Software in use: Inventor 2013, SolidWorks 2011
    Also experience with: Solid Edge untill ST4,
    Please use plain text.
    Contributor
    stracy99
    Posts: 14
    Registered: ‎01-14-2011

    Re: ilogic-how to make an error message using numeric parameter

    02-19-2013 05:28 AM in reply to: VdVeek

    Rob thanks for the help.    I  need the parameter "ARM_ANGLE" to read a non numeric value such as #### or show an empty box.  I have other parameters that use the "ARM_ANGLE" to calculate their values such as the "WELD_ANGLE" which also need to show #### or an empty box if no arm is selected or no value for "ARM_ANGLE" is entered.

     

    I think I can do this by changing all the parameters to a text format instead of numeric.

     

    I did like the idea of a message box but I can have it ask to enter an "ARM_ANGLE" value.

     

     

    Thanks again for the help,

    Steve

     

     

    Please use plain text.