Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to access an embedded excel file that is in a part from the assembly that the part is used in. I can't quite figure it out. Every time I run this iLogic rule its trying to access a spreadsheet embedded in the assembly. How can I tell Inventor to look at the part and use the excel embedded there instead of the assembly?
Sub Main() Dim oDoc As Document oDoc = ThisApplication.ActiveDocument Dim oRefDocs As DocumentsEnumerator oRefDocs = oDoc.AllReferencedDocuments Dim oRefDoc As Document For Each oRefDoc In oRefDocs If oRefDoc.DocumentType = kPartDocumentObject Then Call Update(oRefDoc) End If Next End Sub Function Update(oEditDoc As Document) Dim oParams As Inventor.Parameters oParams = oEditDoc.ComponentDefinition.Parameters oParams.ParameterTables.AddExcelTable("C:\MYEXCELFILE.xlsx", "C42", False) oXcel = oEditDoc.ReferencedOLEFileDescriptors.Item(1) oXcelName = oXcel.DisplayName GoExcel.CellValue("3rd Party:" & oXcelName, "Sheet1", "D2") = Parameter1 GoExcel.CellValue("3rd Party:" & oXcelName, "Sheet1", "D3") = Parameter2 End Function
Andrew In’t Veld
Designer / CAD Administrator
Solved! Go to Solution.