Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
arron.craig
540 Views, 2 Replies

ilogic rule for placing custom rev table on sheet

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.

 

 

dgreatice
in reply to: arron.craig

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
arron.craig
in reply to: dgreatice

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