Message 1 of 4
iLogic: merge iProperties and add sequence numbers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I need little bit help here.
I want to merge assembly 'Part Number' and child parts 'Description'.
Example:
Assembly - Part number: '01'
Part - Description: 'side'
Part - Description: 'top'
Part - Description: 'bottom'
Result be '01_01_side'; '01_02_top'; '01_03_bottom'
I have some code together,but if i have two same parts in an assembly, code reads them also twice
(example: 1x top, 1x bottom, 2x side - 01_01_top, 01_02_bottom, 01_04_side)
Dim oOcc As ComponentOccurrence Dim oAss As AssemblyDocument oAss = ThisDoc.Document For Each oOcc In oAss.ComponentDefinition.Occurrences oPart = oOcc.Name Description = iProperties.Value(oPart, "Project", "Description") PartNumber = iProperties.Value(oAss, "Project", "Part Number") NewName = PartNumber & "_" & oNR & "_" & Description If Not Description = "" Then iProperties.Value(oPart, "Project", "Part number") = NewName End If oNR = oNR + 1 If oNR < 10 Then oNR = "0" + CStr(oNR) Else oNR = CStr(oNR) End If Next