OnPopulateFileMetadata problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Here's an odd one.
With reference to this post - which works fine for me in Inventor 2016 by the way:
I can't get the filename of a "save as" or "save copy as" operation to change to the newfilename from this routine.
Private Sub m_fileUIEvts_OnPopulateFileMetadata(ByVal FileMetadataObjects As ObjectsEnumerator, ByVal Formulae As String, ByVal Context As NameValueMap, ByRef HandlingCode As HandlingCodeEnum)
.......
Dim current As Inventor.FileMetadata
'Dim oMetaData As FileMetadata
'If FileMetadataObjects.Count > 0 Then
'For Each oMetaData In FileMetadataObjects
'suggest custom name
'oMetaData.FileName = "asdk_" & oMetaData.FileName
'oMetaData.FileNameOverridden = True
'Next oMetaData
'tell Inventor the event is handled
'HandlingCode = HandlingCodeEnum.kEventHandled
'End If
'current = DirectCast(FileMetadataObjects.Item(1), FileMetadata)
'current = FileMetadataObjects.Item(1)
'current.FileName = str2
'current.FileNameOverridden = True
System.Windows.Forms.Application.DoEvents()
current = DirectCast(FileMetadataObjects.Item(1), FileMetadata)
current.FileName = str2
current.FileNameOverridden = True
HandlingCode = Inventor.HandlingCodeEnum.kEventHandled
System.Windows.Forms.Application.DoEvents()
'For Each current In FileMetadataObjects
'current.FileName = str2
'current.FileNameOverridden = True
'Next
'HandlingCode = HandlingCodeEnum.kEventHandled
As you can see, i've tried all sorts of ways, but no matter what I di the file always save as part1.ipt etc.
Can anyone out there see what the problem might be?
Many thanks
Dave