Insert revision table using bottom left corner with iLogic?

Insert revision table using bottom left corner with iLogic?

skatzY7HV8
Enthusiast Enthusiast
2,982 Views
2 Replies
Message 1 of 3

Insert revision table using bottom left corner with iLogic?

skatzY7HV8
Enthusiast
Enthusiast

Hello,

 

Based on the documentation and the helpful users of this forum, I've got an iLogic rule to automatically place a revision table of a specific style into a drawing. However, this inserts the revision table using the top left corner as the insertion point (our revision table adds new rows going up instead of going down).

 

Is it possible to use the bottom left corner as the insertion point on a revision table?

 

Thanks

Stephen

 

Dim oDrawingDoc As DrawingDocument
oDrawingDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
oSheet = oDrawingDoc.ActiveSheet

Dim oWidthRevTable As Double
oWidthRevTable = oDrawingDoc.UnitsOfMeasure.ConvertUnits(7+39/64,"in","cm") 'Set you custom width table

'Add Revision table
Dim oTablePt As Point2d
oTablePt = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Border.RangeBox.MaxPoint.X - oWidthRevTable, oSheet.TitleBlock.RangeBox.MaxPoint.Y)

If oSheet.RevisionTables.Count = 0 Then
	Dim oRevTableId As RevisionTableStyle
    	oRevTableId = oDrawingDoc.StylesManager.RevisionTableStyles.Item("ABC RevTable")
	Dim oRevTable As RevisionTable
	oRevTable = oSheet.RevisionTables.Add2(oTablePt, True, True, True, "0", oRevTableId, )
Else
    MessageBox.Show("Revision Table already exist", "Autodesk Inventor")
End If

 

0 Likes
Accepted solutions (1)
2,983 Views
2 Replies
Replies (2)
Message 2 of 3

JamieVJohnson2
Collaborator
Collaborator
Accepted solution

So the table is hard-wired to use the upper left corner for its position.  This means during insert that's the only point you get.  However, you can calculate the desired position of that point also using revisiontable.rangebox to offset it vertically as well.  You can even drop the table, let it draw in full, modify rows ect, then move the table after calculating its size limits(rangebox) vs the position property (upper left corner).

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 3

skatzY7HV8
Enthusiast
Enthusiast

Unfortunate that that is the case, but not a difficult workaround.

 

Dim oDrawingDoc As DrawingDocument
oDrawingDoc = ThisApplication.ActiveDocument

Dim oSheet As Sheet
oSheet = oDrawingDoc.ActiveSheet



'Add Revision table
Dim oTablePt As Point2d
oTablePt = ThisApplication.TransientGeometry.CreatePoint2d(0,0)

If oSheet.RevisionTables.Count = 0 Then
	Dim oRevTableStyle As RevisionTableStyle
    oRevTableStyle = oDrawingDoc.StylesManager.RevisionTableStyles.Item("ABC Revision Table")
	Dim oRevTable As RevisionTable
	oRevTable = oSheet.RevisionTables.Add2(oTablePt, True, True, True, "0", oRevTableStyle, )
Else
    MessageBox.Show("Revision Table already exist", "Autodesk Inventor")
End If

Dim oRevTableItem As RevisionTable
oRevTableItem = oSheet.RevisionTables.Item(1)

Dim oWidthRevTable As Double
oWidthRevTable = oRevTableItem.RangeBox.MaxPoint.X - oRevTableItem.RangeBox.MinPoint.X

Dim oHeightRevTable As Double
oHeightRevTable = oRevTableItem.RangeBox.MaxPoint.Y - oRevTableItem.RangeBox.MinPoint.Y

oTablePt = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Border.RangeBox.MaxPoint.X - oWidthRevTable, oSheet.TitleBlock.RangeBox.MaxPoint.Y + oHeightRevTable)

oRevTableItem.Position = oTablePt