Autodesk Inventor Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I need to suppress a pattern in an 2nd level subassembly. But is only able to do it in the same level where the pattern is placed etc:
If Length < 3000 mm Then
Component.IsActive("1 st level subassembly", "Name of pattern in 1nd level subassembly") = False
End If
But if i do it with an MakePath... etc.:
If Length < 3000 mm Then
Component.IsActive(MakePath("1 st level subassembly", "2 nd level subassembly", "Name of pattern in 2nd level subassembly")) = False
End If
If Length < 3000 mm Then
Component.IsActive(MakePath("1 st level subassembly", "2 nd level subassembly"), "Name of pattern in 2nd level subassembly") = False
End If
is it not possible to suppress a pattern by an MakePath?
Re: iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
No, you can't suppress a pattern in a subassembly or 2nd level subassembly. But here's a workaround:
Create a rule in the 2nd level subassembly. Then pass the Length parameter from a rule in the top-level assembly with a statement like this:
Parameter("2 nd level subassembly", "Length") = Length
This will propagate the value from the top level assembly, and it will trigger the running of the rule in the 2nd level subassembly.

Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.
Re: iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Rene
Try this
compo = Component.InventorComponent(MakePath("1 st level subassembly", "2 nd level subassembly"))
Dim oPattern As OccurrencePattern
oPattern = compo.Definition.OccurrencePatterns.Item("Name of pattern in 2nd level subassembly")
Dim oPatternElement As OccurrencePatternElement
For Each oPatternElement In oPattern.OccurrencePatternElements
Dim oOcc As ComponentOccurrence
For Each oOcc In oPatternElement.Occurrences
'oOcc.Unsuppress
oOcc.Suppress
Next
Next
InventorVb.DocumentUpdate()
René J
Re: iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I`m trying to do something similar.
I have a main assemblie with several sub assemblies. Im trying to suppress a assembly within the sub assembly from the main assembly. I have made an iLogic rule in the subassembly which works, but how can I link the parameteres from the subassembly to the main assembly?
Re: iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I figured it out!
If Fundament_type="Bolted connection" ThenParameter("XXXXXXXXXXXXXX:1", "Fundament") = "Bolted"Parameter("XXXXXXXXXXXXXX:1", "Fundament")="Bolted"End If
If Fundament_type = "Welded connection" ThenParameter("XXXXXXXXXXXXXX:1", "Fundament")="Welded"Parameter("XXXXXXXXXXXXXX:1", "Fundament")="Welded"End If
Re: iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I've got this same problem.
I have a sub assembly with 4 parts in it that i need to switch between in different conditions. In the subassembly itself, i've got rules that disable, set invisible, and set the bom to reference for the ones that aren't used in the specific condition. In the sub it works just fine.
When loading the sub into the main model - all pieces are shown.
I tried making a rule in the main file:
Parameter("file.iam", "LENGTH") = ExisingVariable
When I run the rule in the main assembly, the parameter is sent to the sub assembly correctly, but all my pieces are still visible in the top level.
Is the case different when using enable/visible/BOMStructure instead of simply suppress?
I dont' think that's the case because I do the same thing (enable/visible/BomStructure) in my top level and I loaded that as an iam into another file and things that were disabled/invisible etc show up correctly in the upper level.
An odd occurence is that I have I part being diabled and invisible and it's showing at about 80-90% transparent. The other 4 things done the same way are completely invisible. Weird Weird results.
Re: iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Adding to the weird....
I removed the offending assemblies from my top level assembly and reinserted them.
Now it "seems" to be working correctly. Hadn't encountered that before.
Re: iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi
There are some difference, when using ilogic to supress parts it is suppress the part and set BOMstructure to reference.
when you using "VBA" you have to change BOMstructure to reference when suppress.
I have modify my code to handle this.
Rene J
Dim Suppress as Boolean
Suppress = True
compo = Component.InventorComponent(MakePath("1 st level subassembly", "2 nd level subassembly"))
Dim oPattern As OccurrencePattern
oPattern = compo.Definition.OccurrencePatterns.Item("Name of pattern in 2nd level subassembly")
Dim oPatternElement As OccurrencePatternElement
For Each oPatternElement In oPattern.OccurrencePatternElements
Dim oOcc As ComponentOccurrence
For Each oOcc In oPatternElement.Occurrences
If Suppress = False Then
oOcc.Unsuppress
oOcc.BOMStructure = 51969 'kDefaultBOMStructure = 51969
Else
If oOcc.Suppressed = True
oOcc.Unsuppress
End If
oOcc.BOMStructure = 51972 'kReferenceBOMStructure = 51972
oOcc.Suppress
End If
Next
Next
InventorVb.DocumentUpdate()
Re: iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Here's what I do:
IF REF_YN = 1 then
RefYN.Enabled = True
RefYN.Visible = True
RefYN.BOMStructure = 51969
else
RefYN.Enabled = False
RefYN.Visible = False
RefYN.BOMStructure = 51972
End If
Based on the condition I either turn the parts on/off. As you can see I set the BOM as well, i do not use suppress itself because I don't want to deal with LOD's as they were giving me all kinds of errors before. This does the same thing and I don't have to deal with LOD's or the errors.
Turns out it's not working again (though the transparencey issue seems ok (fingers crossed)).
I have a section of pipe that can be 1-2 pipe(s), 1-2 plate(s), or a combination thereof. In one specific case, i have 4 different ends on just one section of the pipe. Seems when i use ComponentReplace to swatch the pieces around, after a couple swaps, the connection what is/isn't visible in the sub assembly gets lost. That's driving me nuts at the moment because otherwise i'm nearly finished ![]()
Re: iLogic, suppress pattern in 2nd level subassembl y
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Here's something interesting - if i place the model into a drawing sheet, it shows up correctly as in only the piece that is supposed to show up shows up.
Of course the drawing sheet is making use of reference and not visible/enabled. Not sure what there's a disconnect on those and it's driving me crazy.


