Good morning,

I am having issues with a piece of ilogic code (included below).
A bit of background. We are a wood shop and I am trying to follow our shop workflows in that we would typically glue veneers and solid wood sticks to a mdf core and then router the desired shape out of that glued up assembly. Trying to follow that workflow in Inventor appears to be almost impossible in that you cannot add a sketch block or ifeature to an assembly in Inventor. I have tried going down the road of adding the sketch block to one of the parts before it gets added to the assembly. The problem with that is that when I extrude the sketch block in a part and add that part to the assembly part of the extruded profile goes into other parts. It needs to be extruded in the assembly to work properly.
Having said all that my solution has been to add several features directly to the assembly and just suppress or un-suppress the feature that is needed. This all seems like a fairly easy workaround except I cannot get the illogic rule to work as intended. It keeps un-suppressing multiple features each time it runs. Please look at the code below and tell me where I am going wrong.
I think it is a big hole in the software that it doesn’t let you add ifeatures or sketch blocks to an assembly. There are many times when steel weldments and wood assemblies need machining after welding or gluing. (end of rant)

Thanks!

Dim ST As Long
'Turn off all Prifiles
Feature.IsActive("LeftStile","OG, 1 3/8")=False
Feature.IsActive("LeftStile","OG, 1 3/4")=False
Feature.IsActive("LeftStile","OG, 2 1/4")=False

Feature.IsActive("LeftStile","OS, 1 3/8")=False
Feature.IsActive("LeftStile","OS, 1 3/4")=False
Feature.IsActive("LeftStile","OS, 2 1/4")=False

Feature.IsActive("LeftStile","QB, 1 3/8")=False
Feature.IsActive("LeftStile","QB, 1 3/4")=False
Feature.IsActive("LeftStile","QB, 2 1/4")=False

Select Case Parameter("Stick_Profile")
Case "OG"
ST=0.5
If Parameter("Door_Thickness") = 1.375 Then
Feature.IsActive("LeftStile","OG, 1 3/8")=True
Feature.IsActive("LeftStile","OG, 1 3/4")=False
Feature.IsActive("LeftStile","OG, 2 1/4")=False
MessageBox.Show("1.375, OG", "Title")
ElseIf Parameter("Door_Thickness") = 1.75 Then
Feature.IsActive("LeftStile","OG, 1 3/8")=False
Feature.IsActive("LeftStile","OG, 1 3/4")=True
Feature.IsActive("LeftStile","OG, 2 1/4")=False
MessageBox.Show("1.75, OG", "Title")
ElseIf Parameter("Door_Thickness") = 2.25 Then
Feature.IsActive("LeftStile","OG, 1 3/8")=False
Feature.IsActive("LeftStile","OG, 1 3/4")=False
Feature.IsActive("LeftStile","OG, 2 1/4")=True
MessageBox.Show("2.25, OG", "Title")
End If

Case "OS"
ST=0.28125
If Parameter("Door_Thickness") = 1.375 Then
Feature.IsActive("LeftStile","OS, 1 3/8")=True
Feature.IsActive("LeftStile","OS, 1 3/4")=False
Feature.IsActive("LeftStile","OS, 2 1/4")=False
MessageBox.Show("1.375, OS", "Title")
ElseIf Parameter("Door_Thickness") = 1.75 Then
Feature.IsActive("LeftStile","OS, 1 3/8")=False
Feature.IsActive("LeftStile","OS, 1 3/4")=True
Feature.IsActive("LeftStile","OS, 2 1/4")=False
MessageBox.Show("1.75, OS", "Title")
ElseIf Parameter("Door_Thickness") = 2.25 Then
Feature.IsActive("LeftStile","OS, 1 3/8")=False
Feature.IsActive("LeftStile","OS, 1 3/4")=False
MessageBox.Show("2.25, OS", "Title")
End If

Case "QB"
ST= 0.500

If Parameter("Door_Thickness") = "1.375" Then
Feature.IsActive("LeftStile","QB, 1 3/8")=True
Feature.IsActive("LeftStile","QB, 1 3/4")=False
Feature.IsActive("LeftStile","QB, 2 1/4")=False
MessageBox.Show("1.375, OG", "Title")

ElseIf Parameter("Door_Thickness") = "1.75" Then
Feature.IsActive("LeftStile","QB, 1 3/8")=False
Feature.IsActive("LeftStile","QB, 1 3/4")=True
Feature.IsActive("LeftStile","QB, 2 1/4")=False
MessageBox.Show("1.75, QB", "Title")

ElseIf Parameter("Door_Thickness") = 2.25 Then
Feature.IsActive("LeftStile","QB, 1 3/8")=False
Feature.IsActive("LeftStile","QB, 1 3/4")=False
MessageBox.Show("2.25, OG", "Title")

End If
End Select
'[ Left Stick
Parameter("LLStick", "LSLStick_x")=Parameter("Stick_Thickness")
Parameter("LLStick", "LSLStick_y")=Parameter("Door_Height")
Parameter("LLStick", "LSLStick_z")=Parameter("Door_Thickness")-Parameter("LIVeneer", "LSIVeneer_z")-Parameter("LEVeneer", "LSEVeneer_z")
']
'[ Right Stick
Parameter("LRStick", "LSRStick_x")=Parameter("Stick_Thickness")
Parameter("LRStick", "LSRStick_y")=Parameter("Door_Height")
Parameter("LRStick", "LSRStick_z")=Parameter("Door_Thickness")-Parameter("LIVeneer", "LSIVeneer_z")-Parameter("LEVeneer", "LSEVeneer_z")
']
'[ Core
Parameter("StileCore", "LSCore_x")=Parameter("Left_Stile_Width")-Parameter("LLStick", "LSLStick_x")-Parameter("LRStick", "LSRStick_x") + ST
Parameter("StileCore", "LSCore_y")=Parameter("Door_Height")
Parameter("StileCore", "LSCore_z")=Parameter("Door_Thickness")-Parameter("LIVeneer", "LSIVeneer_z")-Parameter("LEVeneer", "LSEVeneer_z")
']
'[ Interior Veneer
Parameter("LIVeneer", "LSIVeneer_x")=Parameter("Left_Stile_Width")+ST
Parameter("LIVeneer", "LSIVeneer_y")=Parameter("Door_Height")
Parameter("LIVeneer", "LSIVeneer_z")=Parameter("Veneer_Thickness")
']
'[ Exterior Veneer
Parameter("LEVeneer", "LSEVeneer_x")=Parameter("Left_Stile_Width")+ST
Parameter("LEVeneer", "LSEVEneer_y")=Parameter("Door_Height")
Parameter("LEVeneer", "LSEVeneer_z")=Parameter("Veneer_Thickness")
']
iLogicVb.UpdateWhenDone = True