Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this short piece of code. It fills in the Description iProperty with the part's browser name in model tree. It works great for all parts and subassemblies found at the top level of an assembly, but it stops there. How can I have it work on ALL parts including parts in sub and sub-sub assemblies etc.?
Many thanks!
'Copy file name (browser name) to description for each occurence in an assembly and subassembly Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'Iterate through all of the occurrences in the assembly Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAsmCompDef.Occurrences Dim oName As String oName = oOccurrence.Name 'split browser name between name and sequence number (what follows after ":") ONameArray = Split(oName, ":") oName=ONameArray(o) 'Fill in part Description from File Name iProperties.Value(oOccurrence.Name, "Project", "Description") = oName Next
Solved! Go to Solution.