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

Another idea would be to use the built-in tool to rename all of your assembly component browser nodes to reflect their Part Number, instead of Filename.  That tool is usually on the Assemble tab, Productivity panel (may not always be showing), then within its drop-down list, named "Rename Browser Nodes".  It has 3 options for the name (Filename, Part Number, Default).  If all the components were renamed to their Part Numbers, you would no longer need to try to extract the Part Number from each component.  If there are more than one of the same part though, you will still have to deal with the "PN:1" & "PN:2" scenario (automatically adds an Index Integer at the end).  That is super simple to deal with though.

Dim sPN As String = occ.Name.Split(":").First

...where Split creates an Array of Strings, divided by that ":" character, then gets the 'First' String in that Array.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)