Message 1 of 16
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using the following code which sends certain parameters down to every part.
My main assembly is made up of 4 separate assemblies and I don't need to send all parameters to each assembly.
For instance, some will go to all parts in asm 1, and different ones need to go to all parts in asm 2 etc.
Is there a way to specify which assemblies to send it to rather than sending it to absolutely everything.
This just takes ages and thought it would streamline the process.
Sub Main() Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument Call Iterate(oAsmDoc.ComponentDefinition.Occurrences, 1) End Sub Private Sub Iterate(Occurrences As ComponentOccurrences, Level As Integer) 'Iterate through Assembly Dim oOcc As ComponentOccurrence For Each oOcc In Occurrences 'Find Parts in Assembly Dim Part As String Part = oOcc.Name On Error Resume Next Parameter(Part, "XXX") = XXX
Parameter(Part, "yyy") = yyy etc etc etc 'Run through the sub assemblies If oOcc.DefinitionDocumentType = kAssemblyDocumentObject Then Call Iterate(oOcc.SubOccurrences, Level + 1) End If Next InventorVb.DocumentUpdate() End Sub
Solved! Go to Solution.