04-21-2020
01:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-21-2020
01:27 PM
Hi, excuse me for being late to answer. It is a heavy week for me.
The first defect in what I proposed to you previously is the type of generated pattern. for that reason the code will not work for you.
Your pattern is driven by feature, so you should use the definition "FeatureBasedOccurrencePattern"
Dim oPatName As String = "Double Row Buckets" Dim doc As AssemblyDocument = ThisDoc.Document Dim oCD As AssemblyComponentDefinition = doc.ComponentDefinition Dim oPatt As Inventor.FeatureBasedOccurrencePattern = oCD.OccurrencePatterns.Item(oPatName) For Each oEl As Inventor.OccurrencePatternElement In oPatt.OccurrencePatternElements If BucketTrigger = 14 Then For Each oCC As ComponentOccurrence In oEl.Occurrences oCC.BOMStructure = 51969 oCC.Visible = True Next End If If BucketTrigger = 6 Then For Each oCC As ComponentOccurrence In oEl.Occurrences oCC.BOMStructure = 51972 oCC.Visible = False Next End If Next
On the other hand, you are already importing into the assembly a parameter of the part that can serve as control of the assembly. I have entered this parameter inside the For - next instruction
Please check the assembly and make sure it meets your needs. I hope this helps with your work. Cheers
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn