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

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

Anonymous

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

Anonymous
Not applicable

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 

 

0 Likes
Reply
627 Views
2 Replies
Replies (2)

MechMachineMan
Advisor
Advisor

Here is a start:

 

http://lmgtfy.com/?q=vb.net+%2B+msdn+%2B+%22Like+operator%22&l=1

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes

Anonymous
Not applicable

Thank you, this helps a lot. i will try it.

0 Likes