Try to reset your display name first :
oPartDoc.DisplayName=""
and check if it already does not contains ipt in it:
Dim model As String = oPartDoc.DisplayName
If Right(model,4)<> ".ipt" Then
model = model & ".ipt"
End If
trigger = iTrigger0
' Get the active assembly document.
Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
'Global Values set
Dim CustomerCityName = iProperties.Value("Custom", "s_length")
Dim CustomerName = iProperties.Value("Custom", "s_width")
Dim CustomerPart = iProperties.Value("Custom", "laser")
Dim CustomerStreet = iProperties.Value("Custom", "description_pl")
Dim WorkOrder = iProperties.Value("Custom", "stock")
Dim Gage = iProperties.Value("Custom", "spot")
Dim RevLevel = iProperties.Value("Custom", "cutting")
' Iterate through all of the documents referenced by the assembly.
Dim oDoc As Document
For Each oDoc In oAsmDoc.AllReferencedDocuments
' Verify that the document is a part.
If oDoc.DocumentType = kPartDocumentObject Then
Dim oPartDoc As PartDocument = oDoc
'Manipulate part
Try
oPartDoc.DisplayName=""
Catch
End Try
Dim model As String = oPartDoc.DisplayName
If Right(model,4)<> ".ipt" Then
model = model & ".ipt"
End If
Try
If iProperties.Value(model,"Summary", "Category") = "Custom" Then
iProperties.Value(model,"Summary", "Category") = "Custom"
Else
'Sets Custom Properties for Components that are in the Main Assembly.
iProperties.Value(model,"Custom" , "Customer City Address") = CustomerCityName
iProperties.Value(model,"Custom" , "Customer Name") = CustomerName
iProperties.Value(model,"Custom" , "Customer Part Number") = CustomerPart
iProperties.Value(model,"Custom" , "Customer Street Address") = CustomerStreet
iProperties.Value(model,"Custom" , "Work Order #") = WorkOrder
iProperties.Value(model, "Custom", "Gage Number") = Gage
iProperties.Value(model,"Custom" , "Rev. Level") = RevLevel
End If
Catch
End Try
End If
Next
MessageBox.Show("Gage Tag information is updated", "Gage Tag Update")