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

    Autodesk Inventor

    Reply
    Distinguished Contributor
    Breeze104
    Posts: 208
    Registered: ‎01-17-2008

    iLogic code not functioning correctly

    211 Views, 16 Replies
    02-08-2012 01:35 PM

    The problem is that for some reason the bolts constraints are not suppressing.  It is simple on/off code but for some reason I am still getting constraint and component errors.

     

    Had to add " " to get code to post...I don't actually have them in my code. 

     

    Here is the code:

     

     

    "If HopperType = "10TADL" Or HopperType = "12BH" Or HopperType = "12TAD" Then

    Component.IsActive("Component Pattern 1:1") = True

    Component.IsActive("Hex Bolt - Inch 5/16-18 UNC - 1:1") = True

    Component.IsActive("Hex Bolt - Inch 5/16-18 UNC - 1:2") = True

    Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = True

    Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = True

     

    Constraint.IsActive("Insert:1") = True

    Constraint.IsActive("Mate:80") = True

    Constraint.IsActive("Mate:78") = True

     

     

    ElseIf HopperType <> "10TADL" Or HopperType <> "12BH" Or HopperType <> "12TAD" Then

    Component.IsActive("Component Pattern 1:1") = False

    Component.IsActive("Hex Bolt - Inch 5/16-18 UNC - 1:1") = False

    Component.IsActive("Hex Bolt - Inch 5/16-18 UNC - 1:2") = False

     

    Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = False

    Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = False

     

    Constraint.IsActive("Insert:1") = False

    Constraint.IsActive("Mate:80") = False

    Constraint.IsActive("Mate:78") = False

     

     

    End If"

     

     

    

    Please use plain text.
    Valued Mentor
    Ktelang
    Posts: 268
    Registered: ‎09-23-2010

    Re: iLogic code not functioning correctly

    02-08-2012 02:13 PM in reply to: Breeze104

    As you are getting your bolts and nuts suppressed

    I assume you have a custom level of representation

    Please find the attached simulated condition the suppression condition is something

    different : open model Bolted and unsuppress the connections

    I have modeled 1 bolted connection and other place from content center at the same location

    And then run the rules  

     

    Else please share the sample file

    ------------------------------------------------------------------------------
    Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
    Inventor 2013 and Vault Basic 2013
    -----------------------------------------------------------------------------
    Please use plain text.
    Valued Mentor
    swordmaster
    Posts: 445
    Registered: ‎12-15-2008

    Re: iLogic code not functioning correctly

    02-08-2012 02:50 PM in reply to: Breeze104

    If you are simply trying to suppress your hardware there is no need to suppress the constraints

    try "commenting out" those lines and run the rules again

    Similarly there is no need to suppress each instance of your pattern

    Inventor 2010 Certified Professional
    Please use plain text.
    Distinguished Contributor
    Breeze104
    Posts: 208
    Registered: ‎01-17-2008

    Re: iLogic code not functioning correctly

    02-09-2012 04:32 AM in reply to: swordmaster

    That is the problem I originally did just suppress the component pattern, but it still thru constraint errors eventhough they should have been shut off in all hopper types except those three listed.

    Please use plain text.
    Distinguished Contributor
    Breeze104
    Posts: 208
    Registered: ‎01-17-2008

    Re: iLogic code not functioning correctly

    02-09-2012 05:23 AM in reply to: Breeze104

    Even coding it like this...the Component Pattern 1:1 is still active and giving error in Design Doctor.

     

     

    If HopperType = "10TADL" Then
    Component.IsActive("Component Pattern 1:1") = True
    Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = True
    Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = True

     

    ElseIf HopperType = "12BH" Then
    Component.IsActive("Component Pattern 1:1") = True
    Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = True
    Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = True

     

    ElseIf HopperType = "12TAD" Then
    Component.IsActive("Component Pattern 1:1") = True
    Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = True
    Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = True


    Else
    Component.IsActive("Component Pattern 1:1") = False
    Component.IsActive("Hex Nut - Inch 5/16 - 18:1") = False
    Component.IsActive("Hex Nut - Inch 5/16 - 18:2") = False

     

    End If

    Please use plain text.
    Distinguished Contributor
    Breeze104
    Posts: 208
    Registered: ‎01-17-2008

    Re: iLogic code not functioning correctly

    02-09-2012 05:49 AM in reply to: Breeze104

    I wanted to give a quick thanks to ya'all for your help so far...

    Eventhough it has solved the issue, I was able to go though all the other rules and really thin them down....THANKS

    Please use plain text.
    Distinguished Contributor
    Breeze104
    Posts: 208
    Registered: ‎01-17-2008

    Re: iLogic code not functioning correctly

    02-09-2012 06:03 AM in reply to: Breeze104

    After using the form I created and switching hopper types I am finding out that the other hopper types that are suppsed to have the nuts and bolts in them aren't correct either.

     

    What is happening is that the nuts and bolts are active but the constraints to put them in place are not activating, so they end up where ever on the end plate of the hopper.

     

    See Pic : http://screencast.com/t/c9SHhdJL

    Please use plain text.
    Distinguished Contributor
    Breeze104
    Posts: 208
    Registered: ‎01-17-2008

    Re: iLogic code not functioning correctly

    02-09-2012 06:31 AM in reply to: Breeze104

    Seems my typing skills need some help...

     


    Breeze104 wrote:

    I wanted to give a quick thanks to ya'all for your help so far...

    Eventhough it has solved the issue, I was able to go though all the other rules and really thin them down....THANKS


    Was suppsed to read "Eventhough it hasn't solved the issue......"

     

    Sorry about that

    Please use plain text.
    Distinguished Contributor
    Breeze104
    Posts: 208
    Registered: ‎01-17-2008

    Re: iLogic code not functioning correctly

    02-09-2012 06:46 AM in reply to: Breeze104

    One other thing I have noticed looking over things.....is that if I right click on Component  Patteren 1:1 is shows a check mark by "Suppressed", but for some reason it is throwing the "Component Pattern failure" error in Design Doctor.

    Please use plain text.
    Valued Mentor
    swordmaster
    Posts: 445
    Registered: ‎12-15-2008

    Re: iLogic code not functioning correctly

    02-09-2012 07:20 AM in reply to: Breeze104

    Ok,

    I made a small test to show how this pattern suppression works.

    This code suppresses  the pattern named "my_pattern" and all of the instances of that pattern.

    Based on the value of the parameter "my_configuration"

    It does not to "touch" the constraints........these are still needed

     

    trigger

    = iTrigger0

    if

    my_configuration = 0 then

    Component.IsActive

    ("my_pattern") = False

    else

    Component.IsActive

    ("my_pattern") = True

    end if

    iLogicVb.UpdateWhenDone

    = True

     

     

    Inventor 2010 Certified Professional
    Please use plain text.