Message 1 of 1
iLogic Sketch Symbol Prompted Entry Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a sketch symbol being used as a nameplate on my drawing. I am currently using iLogic to populate this from an excel file.
An issue arises when I need a second nameplate with different information on the same drawing, the code populates both sketch symbols.
I'm trying, with no luck, to specify the name of the symbol I am trying to fill out so it only populates the desired nameplate and not both.
'Browse for the Excel file Dim oFileDlg As inventor.FileDialog = Nothing InventorVb.Application.CreateFileDialog(oFileDlg) On Error Resume Next myXLS = iProperties.Value("Custom", "Link") 'look at NamePlate of the spreadsheet GoExcel.Open(myXLS, "NamePlate") 'define the drawing Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Dim oPromptEntry 'gather the current sheet name Dim oCurrentSheet oCurrentSheet = oDoc.ActiveSheet.Name Dim oSymbol As SketchedSymbol Dim oSymbols As SketchedSymbols For Each oSheet In oDoc.Sheets 'activate the sheet ThisApplication.ActiveDocument.Sheets.Item().Activate oSymbols=oSheet.SketchedSymbols oTextBoxes=oSymbol.Definition.Sketch.TextBoxes For Each oSymbol In oSymbols For Each oTextBox In oSymbol.Definition.Sketch.TextBoxes 'look at the first 100 rows of the Excel file 'start at row 2, since row 1 contains headings For rowCheck = 2 To 100 'read the value of the column A Dim myCell As String myCell = GoExcel.CellValue("A" & rowCheck) 'compare the titleblock field name to the value in column A If myCell = oTextBox.Text Then 'get the value from column B oPromptEntry = GoExcel.CellValue("B" & rowCheck) 'set the prompted entry value Call oSymbol.SetPromptResultText(oTextBox, oPromptEntry) End If Next Next Next Next 'return to original sheet ThisApplication.ActiveDocument.Sheets.Item(oCurrentSheet).Activate 'clear the status bar message ThisApplication.StatusBarText = "" 'Closes the excel sheet GoExcel.Close