Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
627 Views, 2 Replies

iLogic get partnumbers of certain parts, create a running list in assembly iprop

Hello Guys,

 

i have a certain assembly with 4-5 Parts and i want to fill the PartNumber of the Assembly with a running list of the ipts Part Numbers (Part1, Part2, Part3). Separated with commas or semicolon.

And how can i define Part 1 with a certain filename form, i.e.

 

If docFile.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value = "*-*-*" Then
Part1 = docFile.PropertySets.Item("Design...

 

 

My Code so far, i hope you can help me out

 

SyntaxEditor Code Snippet

Dim openDoc As AssemblyDocument
openDoc = ThisApplication.ActiveDocument
Dim customPropSet As PropertySet 
Dim Parts As DocumentsEnumerator
Parts = openDoc.AllReferencedDocuments
Dim Part As Document
Dim NameList As New ArrayList
'Iterate through the occurrences And collect the name. 
For Each docFile In openDoc.AllReferencedDocuments
oPartNumber = (docFile.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value) 
    NameList.add(oPartNumber) 
Next
If openDoc.DocumentType = 12291 Then
    For Each docFile In openDoc.AllReferencedDocuments    
        If docFile.DocumentType = 12291 Then    
                     
                    Try
                    
                    
                    If Left(System.IO.Path.GetFileNameWithoutExtension(docFile.FullFileName),7) = "Schraub" Then                                         
                    docFile.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value = NameList
                    
                    Else
                    End If    
                                            
                    Catch
                    End Try
            
        End If         
    Next    
Else    
End If