Message 1 of 3
Loading data from the .xlsx table into the table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone, is it possible to modify this code (received from FINET_Laurent) so that the data is written to an table (General ) on the Inventor drawing page. Not in Titleblock
Thank you very much for your reply
Sub main
Dim excelTable As Dictionary(Of String, String) = get_inputs
Dim doc As Inventor.DrawingDocument = ThisApplication.ActiveDocument
Dim titleblock As Inventor.TitleBlock = doc.ActiveSheet.TitleBlock
Dim s As Inventor.DrawingSketch = titleblock.Definition.Sketch
For Each t As Inventor.TextBox In s.TextBoxes
For Each k As String In excelTable.Keys
If t.Text = "<" & k & ">" Then
titleblock.SetPromptResultText(t, excelTable(k))
Exit For
End If
Next
Next
End Sub
Function get_inputs() As Dictionary(Of String, String)
Dim propertiesColumn As String = "A"
Dim valuesColumn As String = "B"
Dim firstLine As Integer = 1
Dim lastLine As Integer = 3
Dim excelTable As New Dictionary(Of String, String)
For i As Byte = firstLine To lastLine
Dim p As String = GoExcel.CellValue("TitleBlock.xlsx", "Tabelle1", propertiesColumn & i)
Dim v As String = GoExcel.CellValue("TitleBlock.xlsx", "Tabelle1", valuesColumn & i)
excelTable.Add(p, v)
Next
GoExcel.Close
Return excelTable
End Function