Hi, below there is a code snippet that sets a custom property named todayDate to current date in all the file parts in all the subfolders under specified root path. I use a version of this (without iterating through files) in an add-in to set date in a drawing title block with one click on a custom ribbon button.
I haven't tested it excessively but it should work, you might be able to create something slicker with apprentice but I've never done that.
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim InventorApp As Inventor.Application
Dim oPartDoc As PartDocument
InventorApp = Marshal.GetActiveObject("Inventor.Application")
Dim txtbx As String = "D:\test"
Dim invCustomPropertySet As PropertySet
Dim todayDate As Date
todayDate = Now
For Each FileInfo As FileInfo In New DirectoryInfo(txtbx).GetFiles("*", SearchOption.AllDirectories)
'MsgBox(FileInfo.FullName)
'MsgBox(FileInfo.Extension)
If FileInfo.Extension = ".ipt" Then
InventorApp.Documents.Open(FileInfo.FullName) 'You can use "InventorApp.Documents.Open(FileInfo.FullName, flase) to hide opened documents"
oPartDoc = InventorApp.ActiveDocument
invCustomPropertySet = oPartDoc.PropertySets.Item("Inventor User Defined Properties") 'Access custom property set
'invCustomPropertySet.Add(todayDate, "todayDate") 'Uncomment if you want to create a property instead of updating one
invCustomPropertySet.Item("todayDate").Value = todayDate 'Set date to now
oPartDoc.Update()
oPartDoc.Close()
End If
Next
End Sub
End Class