- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I have a function that creates a custom form in a drawing which is working almost as I need. I pass the function a part number and it populates the columns based on that. This works fine (code included below), however what I want to be able to do is pass X amount of part numbers to the function, then a new row created for each part number.
How would I go about doing this?
Thanks in advance.
Function funcCustomTable(strPartNo As String)
Logger.Debug("funcCustomTable run with strPartNo: " + strPartNo)
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDrawDoc.ActiveSheet
Dim oCols As Integer = 4
Dim oRows As Integer = 1
Select Case strPartNo
Case "1234567"
strDesc = "description of part"
End Select
' Set the column titles
Dim oTitles(3) As String
oTitles(0) = "ITEM"
oTitles(1) = "PART NO"
oTitles(2) = "QTY"
oTitles(3) = "DESCRIPTION"
Logger.Debug("Titles Created")
' Set the contents of the custom table (contents are set row-wise)
Dim oContents(3) As String
oContents(0) = "1"
oContents(1) = strPartNo
oContents(2) = 1
oContents(3) = strDesc
Logger.Debug("Contents Created")
' Set the column widths (defaults to the column title width if not specified)
Dim oColumnWidths(3) As Double
oColumnWidths(0) = 1
oColumnWidths(1) = 2.9
oColumnWidths(2) = 1
oColumnWidths(3) = 9.7
Logger.Debug("Widths Adjusted")
oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(15, 15)
Logger.Debug("Placement Point Added")
' Create the custom table
Dim oCustomTable As CustomTable
Try
oCustomTable = oSheet.CustomTables.Add("SUBSTITUTE MATERIAL", oPlacementPoint, oCols, oRows, oTitles, oContents, oColumnWidths)
Catch ex As Exception
Logger.Debug(ex.ToString)
End Try
Solved! Go to Solution.