12-05-2020
02:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-05-2020
02:54 AM
For this task is better to start from Excel VBA. You can add reference to "Inventor Object Library" and then you can use Inventor.ApprenticeServer for writing data to iProperties. Apprentice has the best performance for this tasks.
Excel VBA example:
Sub WriteData()
Dim appServer As Inventor.ApprenticeServerComponent
Set appServer = New ApprenticeServerComponent
Dim oSheet As Worksheet
Set oSheet = ThisWorkbook.ActiveSheet
For i = 2 To 3
Dim file As String
Dim checkedBy As String
Dim checkedDate As Date
file = oSheet.Range("A" & i).Value
checkedBy = oSheet.Range("B" & i).Value
checkedDate = oSheet.Range("C" & i).Value
Dim invDoc As Inventor.ApprenticeServerDocument
Set invDoc = appServer.Open(file)
invDoc.PropertySets("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")("Checked By").Value = checkedBy
invDoc.PropertySets("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")("Date Checked").Value = checkedDate
invDoc.PropertySets.FlushToFile
invDoc.Close
Next
End Sub
Test data preview:
Test data preview
Add reference to Inventor in Excel VBA