- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I make drawings from my sheet metal parts. In these drawings I would like to add a table with information about bending (not the standard bendtable). I've found some rules to set up a table by using iLogic and I tried to change them to the table I want to set up, but I can't make it work. I hope I can make it work with your help.
Here is an example of how the table needs to be:
The reason why I want to set it up with iLogic is because I want to set up table the quickly and don't want to look for the table between my files.
I attached 2 files.
Rule 1 has the benefit of filling in all the 'contents'. Because as you can see I want te fill in some of the places.
But when I try to add more rows I get errors.
With rule 2 I have more rows, but I can't fill in the 'contents'.
I tried to combine the codes to make it work for me and here is my code:
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then MsgBox("A Drawing Document must be active for this rule (" & iLogicVb.RuleName & ") to work. Exiting.",vbOKOnly+vbCritical, "WRONG DOCUMENT TYPE") Exit Sub End If Dim oDDoc As DrawingDocument = ThisDrawing.Document Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet Dim oTitle As String = "ZET INSTELLINGEN" Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oPPoint As Point2d = oTG.CreatePoint2d(1, 28.7) Dim oCols As Integer = 3 Dim oRows As Integer = 7 'Number of column titles supplied must match number of columns specified 'Dim oColTitles() As String = {" ", "Dimension L1", "Dimension L2", "Material", "Cost" } 'or Dim oColTitles(oCols - 1) As String oColTitles(0) = " " '1st column title oColTitles(1) = "U" '2nd column title oColTitles(2) = "V" '3rd column title ' Set the contents of the custom table (contents are set row-wise) Dim oContents(21) As String oContents(0) = "Groef" oContents(1) = " " oContents(2) = " " oContents(3) = " " oContents(4) = " " oContents(5) = " " oContents(6) = "Zetting" oContents(7) = "Aanslag" oContents(8) = "Zet lengte" oContents(9) = "1" oContents(10) = " " oContents(11) = " " oContents(12) = "2" oContents(13) = " " oContents(14) = " " oContents(15) = "3" oContents(16) = " " oContents(17) = " " oContents(18) = "4" oContents(19) = " " oContents(21) = " " 'Dim oColWidths() As Double = {1.25, 2.5, 2.5, 1.5, 1.25 } 'or 'could run a function here to determine how wide each column needs to be, then set them individually Dim oColWidths(oCols - 1) As Double oColWidths(0) = 2.5 '1st column width oColWidths(1) = 2.5 oColWidths(2) = 2.5 'Dim oRowHeights() As Double = {.25, .25, .25, .25, .25, .25 } 'or 'could run a function here to determine how tall each row needs to be, then set them individually Dim oRowHeights(oRows - 1) As Double For oRow As Integer = 0 To (oRows-1) oRowHeights(oRow) = .25 Next Dim oCTable As CustomTable = oSheet.CustomTables.Add(oTitle, oPPoint, oCols, oRows, oColTitles, oContents, oColWidths, oRowHeights)
I can't get the code to work.
Is there a way to make the table like how I want to set it up, or do you have other, smarter or faster ideas to set up the table?
Thanks for your help,
Luc
Solved! Go to Solution.