iLogic switch components in a pattern

iLogic switch components in a pattern

Ted.F
Participant Participant
1,077 Views
5 Replies
Message 1 of 6

iLogic switch components in a pattern

Ted.F
Participant
Participant

Hi,

 

 So, this is my first post in the forum so bare with me. 

 

Goal: Swap out (all) parts in a pattern based on a selection (user parameter)

 

Issue: When selecting options it does not update correctly

 

What works: Option 1- Select width 06, 09, 12, 15, 18 etc. Option 2- Select part type wood, uhmw

 

If I make a selection in option 2 I have to change Option 1 to a choice that is a qty of 1, then make a selection that has a larger qty. and it all works fine.

 

Pattern has both wood wearstrip and uhmw wearstrip selected as components and I toggle back and forth.

 

Not sure what I am missing and ANY help would be appreciated.

 

SyntaxEditor Code Snippet

'Select wearstrip style then pattern


                If Wearstrip_Style = "WOOD" Then
                
                    Component.IsActive("Wood Wearstrip")= True
                    Component.IsActive("UHMW Wearstrip")= False
                                    
                ElseIf Wearstrip_Style = "UHMW" Then
                
                    Component.IsActive("UHMW Wearstrip")= True
                    Component.IsActive("Wood Wearstrip")= False
                                
                End If
                
        Parameter.UpdateAfterChange=True            


    If Chain_Width = "06 in" Then
        Parameter("Carryway_Wearstrip") = 1
        Parameter("Return_Wearstrip_Spacing") = 2.625
        Parameter("Return_Wearstrip_Qty") = 2
                
    ElseIf Chain_Width = "09 in" Then
        Parameter("Carryway_Wearstrip") = 1
        Parameter("Return_Wearstrip_Spacing") = 4.125
        Parameter("Return_Wearstrip_Qty") = 2
        
    ElseIf Chain_Width = "12 in" Then
        Parameter("Carryway_Wearstrip") = 1
        Parameter("Return_Wearstrip_Spacing") = 5.625
        Parameter("Return_Wearstrip_Qty") = 2
            
    ElseIf Chain_Width = "15 in" Then
        Parameter("Carryway_Wearstrip") = 2
        Parameter("Return_Wearstrip_Spacing") = 7.125
        Parameter("Return_Wearstrip_Qty") = 2
        
    ElseIf Chain_Width = "18 in" Then
        Parameter("Carryway_Wearstrip") = 3
        Parameter("Return_Wearstrip_Spacing") = 4.3125
        Parameter("Return_Wearstrip_Qty") = 3

 

 

0 Likes
1,078 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

Hi Ted_fNRXGQ,

 

just try this code snippet at the end of the rule!

 

 

    'Updating the document
    InventorVb.DocumentUpdate()

 

0 Likes
Message 3 of 6

Ted.F
Participant
Participant

Armin,

 

  Thanks for the response. I actually have that in the bottom of the code. It cut off my code when I posted.

 

SyntaxEditor Code Snippet

End If
    
    Parameter.UpdateAfterChange=True
    
    
InventorVb.DocumentUpdate()
0 Likes
Message 4 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @Ted.F,

 

 

In Inventor 2018, new level of details is required to modify / suppress component in an assembly as shown below.

 

LevelOfDetail.jpg

 

A sample assembly is created to test and attached with this post. Below iLogic rule is created to test suppression of patterns.

 

 
Component.IsActive("Wood Wearstrip:1") = False
Component.IsActive("UHMW Wearstrip:1") = False
Component.IsActive("Component Pattern 1:1") = False
Component.IsActive("Component Pattern 2:1")= False

Please feel free to contact if there is any queries.

 

If solves problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 6

Ted.F
Participant
Participant

Chandra,

 

  Thank you for the response. I am already using LOD and suppression for some other parts. However, I do not think it would be an efficient way to address this assembly. Everything works great, except the regeneration of that pattern.

1.jpg

0 Likes
Message 6 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @Ted.F,

 

Regeneration of patterns is working fine on running following iLogic code

 

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

Can you please provide assembly and associated files to test? mention Inventor versions also.

 

Please make sure that files are non confidential one.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes