12-09-2018
04:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-09-2018
04:01 PM
I'm trying to place a revision table from a defined style titled "ABC Rev Table".
I have tried to adapt the code from the this post but cannot find how to define which table to insert.
Using the API help I got as far as finding the RevisionTables.Add2 method which has an arg called
[RevisionTableStyle] As Variant but I have no idea how to use it,
| RevisionTableStyle | Variant | Optional input RevisionTableStyle object that specifies the style to use for the table. If not provided, the default style is used. |
Solved! Go to Solution.
12-09-2018
08:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-09-2018
08:08 PM
Try this:
Dim oDrawingDoc As DrawingDocument oDrawingDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet oSheet = oDrawingDoc.ActiveSheet Dim oWidthRevTable As Double oWidthRevTable = 15.02 'Set you custom width table Dim oTablePt As Point2d oTablePt = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Border.RangeBox.MaxPoint.X - oWidthRevTable, oSheet.Border.RangeBox.MaxPoint.Y)'Add Revision table in Top Left Corner If oSheet.RevisionTables.Count = 0 Then Dim oRevTable As RevisionTable oRevTable = oSheet.RevisionTables.Add(oTablePt) Dim oRevStyle As Style For Each oRevStyle In oDrawingDoc.StylesManager.RevisionTableStyles If oRevStyle.Name = "ABC Rev Table" Then oRevTable.Style = oRevStyle End If Next Else MessageBox.Show("Revision Table already exist", "Autodesk Inventor") End If
Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.
Autodesk Inventor Professional Certified 2014
Autodesk Inventor Professional Certified 2014
12-10-2018
10:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
12-10-2018
10:54 AM
All I had to edit was the below line for placement and its works perfectly, thankyou
oTablePt = ThisApplication.TransientGeometry.CreatePoint2d(27.6,1.6)'Add Revision table in Top Left Corner