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

As a reference, here is the original rule that was given to us by a vendor before my time here.

 

Dim oDoc As Document = ThisDoc.Document
Dim oCompDef As Inventor.ComponentDefinition = oDoc.ComponentDefinition
Dim oCompOcc As Inventor.ComponentOccurrence
For Each oCompOcc in oCompDef.Occurrences
    searchfor = ":"
    firstchr = oCompOcc.Name.IndexOf(searchfor)
    firstchr = firstchr+1
    totalchr = Len(oCompOcc.Name) - firstchr 
    post1 = Right(oCompOcc.Name, totalchr)
    newBrowserName1 = iProperties.Value(oCompOcc.Name, "Project", "Part Number") & post1
    oCompOcc.Name = newBrowserName1
    newBrowserName2 = iProperties.Value(oCompOcc.Name, "Project", "Part Number") & " ~ " & iProperties.Value(oCompOcc.Name, "Project", "Description") & ":" & post1
    oCompOcc.Name = newBrowserName2
    firstchr= ""
    totalchr= ""
    post1 = ""
    newBrowserName1 = ""
    newBrowserName2= ""
Next