10-20-2021
04:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-20-2021
04:48 AM
Hi @sheetal.b
The trick to find all these occurrences is to use Occurrences.AllReferencedOccurrences in your main assembly.
All you need is a document-object for your 'Part 1'. Here's an example, assuming the subassembly occurrences are named 'Subassembly B:1', 'Subassembly B:2', 'Subassembly B:3' and so on. And the 'Part1'-occurrence in the subassembly is named 'Part1:1'.
Dim oAsm As AssemblyDocument = ThisDoc.Document Dim oDef As AssemblyComponentDefinition = oAsm.ComponentDefinition Dim subAsm As AssemblyDocument = oDef.Occurrences.ItemByName("Subassembly B:1").Definition.Document Dim part1 As PartDocument = subAsm.ComponentDefinition.Occurrences.ItemByName("Part1:1").Definition.Document For Each oOcc As ComponentOccurrence In oDef.Occurrences.AllReferencedOccurrences(part1) oOcc.Visible = False Next
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website