You can merge Tobias's code into my iLogic rule, like below:
Sub Main()
Dim oCls As New WindowsFunc(ThisApplication)
oCls.PlaceRevTable
' Move the revision table to proper position.
UpdateCustomTablePosition(0,0)
End Sub
Sub UpdateCustomTablePosition(PosX As Double, PosY As Double )
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisDoc.Document
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet
Dim oTable As RevisionTable
Dim oTablePosition As Point2d
' Specify the position to move the revision table to.
oTablePosition = ThisApplication.TransientGeometry.CreatePoint2d(PosX, PosY)
For Each oTable In oSheet.RevisionTables
If oTable.Title = "REVISION HISTORY" Then
oTable.Position = oTablePosition
End If
Next
End Sub
Class WindowsFunc
Private Declare Auto Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Sub mouse_event Lib "user32"(ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private oApp As Inventor.Application
Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
Sub New(m_App As Inventor.Application)
oApp = m_App
End Sub
Sub PlaceRevTable
Dim x As Long = oApp.Left + oApp.Width / 2
Dim y As Long = oApp.Top + oApp.Height / 2
SetCursorPos(x, y)
Dim i As Integer
Do While i < 50
If i = 0
oApp.CommandManager.ControlDefinitions.Item("VaultRevisionBlock").Execute2(False)
End If
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
i = i +1
Loop
End Sub
End Class
Can you try it there to check if it works well?
If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.
Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.