Move a table on a drawing sheet

Move a table on a drawing sheet

ewcler
Enthusiast Enthusiast
920 Views
1 Reply
Message 1 of 2

Move a table on a drawing sheet

ewcler
Enthusiast
Enthusiast

I am working on some code that will move a custom table from one point to another.  This is what I have so far.

You need to have a drawing document with a custom table already in it.

Sub MoveTable()

    Dim oApp As Application
    Set oApp = ThisApplication
    

    Dim oDoc As DrawingDocument
    Set oDoc = oApp.ActiveDocument
    Dim osheet As Sheet
    Set osheet = oDoc.ActiveSheet
    
    Dim oTable As CustomTable
    Set oTable = osheet.CustomTables.Item(1)
    
    'This is where I want to make the move, but it doesn't work
    Call oTable.Position.TranslateBy(oApp.TransientGeometry.CreateVector2d(5, 5))
     
End Sub

 

 

 

 

 

Eddie Cler
Paul's Machine & Welding Corp.
Dell Precision T3600- Xeon E5-1620 @ 3.6 GHz 32GB Ram - Nvidia Quadro 4000 Windows 7
0 Likes
921 Views
1 Reply
Reply (1)
Message 2 of 2

ewcler
Enthusiast
Enthusiast

I sorted it out.

 

 

oPoint.Y = oPoint.Y + oCustomTable.RangeBox.MaxPoint.Y - oCustomTable.RangeBox.MinPoint.Y
oCustomTable.Position = oPoint

 

 

 

Eddie Cler
Paul's Machine & Welding Corp.
Dell Precision T3600- Xeon E5-1620 @ 3.6 GHz 32GB Ram - Nvidia Quadro 4000 Windows 7