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

Hi @GosponZ 

 

You can use Regex for this.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Imports System.Text.RegularExpressions
oDoc = ThisDoc.Document
oSheets = oDoc.Sheets

    For Each oSheet In oSheets
        oSheet.activate
        oView = oSheet.DrawingViews.Item(1)
        modelName = oView.ReferencedDocumentDescriptor.ReferencedDocument
        oProp = modelName.PropertySets.Item("Design Tracking Properties")
		
		sSpecicals = "[#$%&'()*+,-./\\~:;]"		
		oPN = Regex.Replace(oProp.Item("Part Number").Value, sSpecicals, "")
		oDesc = Regex.Replace(oProp.Item("Description").Value , sSpecicals, "")

        ActiveSheet.Sheet.Name = oPN & " " & oDesc 
    Next

oSheets(1).activate
iLogicVb.UpdateWhenDone = True