jbaum Posted April 5, 2016 Posted April 5, 2016 So, I have successfully used the iLogic browser to input an excel file as a Table on my drawing. Not an issue. However, what I am having an issue with is having Inventor read a column in my new table to find a value specified by a design worksheet; Finding that/those row(s), and then only showing the row(s) that match the values from the design worksheet. ' Set a reference to the active drawing document Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument ' Set a reference to the active sheet Dim oActiveSheet As Sheet oActiveSheet = oDrawDoc.ActiveSheet ' Create the placement point for the table Dim oPoint As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(25, 25) ' Create the table by specifying the source Excel file ' This assumes that the first row in the Excel sheet specifies the column headers ' You can specify a different row using the last argument of the AddExcelTable method Dim oExcelTable As CustomTable oExcelTable = oActiveSheet.CustomTables.AddExcelTable("K:\Inventor\ADTLETMODELDATA.xlsx", oPoint, "Evaporator Information") This code works fine. I am also familiar with how to get a value from a spreadsheet and use it. Just wondering how to browse a column and then only show the needed values. Any ideas or help would be appreciated. Quote
jbaum Posted April 11, 2016 Author Posted April 11, 2016 Ok, so now i am working on a different approach. Using ilogic and a case statement to build a table of information as user choose the information in a form. However, when I do that, I only want one row to populate instead the table produces three rows, one title row that is empty, one row full of data, and a third row that is empty. Is there a way to hide the title row and the last row? The code is as follows I created a custom table, in the styles editor. However, I am not sure how to reference the new table I created. Is there another way to remove the 1st and third row. SyntaxEditor Code Snippet Select Case EvapModel Case "ADT-040" Dim oContents (0 To 11) As String oContents(0) = "ADT-040" oContents(1) = "29 1/2 in" oContents(2) = "17 1/4 in" oContents(3) = "-" oContents(4) = "-" oContents(5) = "1/2 in OD" oContents(6) = "7/8 in OD" oContents(7) = "3/4 in MPT" oContents( = "28" oContents(9) = "1" oContents(10) = "1.8" oContents(11) = "1" Dim oPoint As Point2d oPoint = ThisApplication.TransientGeometry.CreatePoint2d(75,15) Dim oCustomTable As CustomTable oCustomTable = oSheet.CustomTables.Add("Evap Details", oPoint, 12, 1, oContents) End Select Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.