03-26-2021
12:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-26-2021
12:01 PM
I have a code started for you, but it still has a bug (or few), so it still needs a little more work. But, I'm headed home for the weekend, so I'm just going to post what I have so far. I hope this helps. Have a great weekend. ![]()
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 oRevTbl As RevisionTable = oSheet.RevisionTables.Item(1)
Dim oTitle As String = oRevTbl.Title
Dim oPos As Point2d = oRevTbl.Position
Dim oRowCount As Integer = oRevTbl.RevisionTableRows.Count
Dim oColCount As Integer = oRevTbl.RevisionTableColumns.Count
Dim oCellCount As Integer = oRowCount * oColCount
Dim oColTitles(oColCount - 1) As String
Dim oColWidths(oColCount - 1) As Double
Dim oRowHeights(oRowCount-1) As Double
Dim oCellContents(oCellCount) As String
Dim oRow, oCol, oCell As Integer
oCell = 0
For oRow = 1 To oRowCount
For oCol = 1 To oColCount
For oCell = 1 To oCellCount - 1
oCellContents(oCell) = oRevTbl.RevisionTableRows.Item(oRow).Item(oCol).FormattedText
If oCell < (oCellCount - 1) Then oCell = oCell + 1
Next
oColTitles(oCol - 1) = oRevTbl.RevisionTableColumns.Item(oCol).Title
oColWidths(oCol - 1) = oRevTbl.RevisionTableColumns.Item(oCol).Width
If oCol < oColCount Then oCol = oCol + 1
Next
oRowHeights(oRow-1) = oRevTbl.RevisionTableRows.Item(oRow).Height
If oRow < oRowCount Then oRow = oRow + 1
Next
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oCTable As CustomTable = oSheet.CustomTables.Add(oTitle, oPos, oColCount, oRowCount, oColTitles, oCellContents, oColWidths, oRowHeights)
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS)
.
If you want and have time, I would appreciate your Vote(s) for My IDEAS
or you can Explore My CONTRIBUTIONS
Wesley Crihfield
(Not an Autodesk Employee)