Hi,
welcome @Anonymous.autodesk.com!
Just as an idea, without any error handling (e.g. if destination table has less rows or columns than the source table, also the parameter "nContent" for "Table.GetValue" and "Table.SetValue" are currently unknown to me).
But with the attached sample drawing this code is working well, hope this is a good starter for you 😉
Public Sub transferTableValues()
Dim tTable1 As AcadTable
Dim tTable2 As AcadTable
Dim tPickedPnt As Variant
'select tables
On Error Resume Next 'in case no object or wrong object type is selected
Call ThisDrawing.Utility.GetEntity(tTable1, tPickedPnt, "Select Source-Table: ")
If Err.Number = 0 Then
Call ThisDrawing.Utility.GetEntity(tTable2, tPickedPnt, "Select Destination-Table: ")
End If
If Err.Number <> 0 Then
Call MsgBox("Selection of Table(s) failed, function cancelled!")
Else
'well, two tables selected, verify that they are not the same ones
If tTable1.Handle = tTable2.Handle Then
Call MsgBox("Source- and Destination table are the same object, please select two different tables, function cancelled!")
Else
'let's start
Dim tRow As Long
Dim tCol As Long
For tRow = 0 To tTable1.Rows - 1
For tCol = 0 To tTable1.Columns - 1
Dim tVal As Variant: tVal = tTable1.GetValue(tRow, tCol, 0)
Call tTable2.SetValue(tRow, tCol, 0, tVal)
Next
Next
End If
End If
End Sub
- alfred -
------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ...
blog.ish-solutions.at ...
LinkedIn ...
CDay 2026------------------------------------------------------------------------------------
(not an Autodesk consultant)