AddTable Method (ActiveX)

Adds a table to a drawing.

Supported platforms: Windows only

Signature

VBA:

RetVal = object.AddTable(InsertionPoint, NumRows, NumColumns, RowHeight, ColWidth)
object

Type: Block, ModelSpace, PaperSpace

The objects this method applies to.

InsertionPoint

Access: Input-only

Type: Variant (three-element array of doubles)

The 3D WCS coordinates in the drawing where the table is inserted.

NumRows

Access: Input-only

Type: Long

The number of rows in the table.

NumColumns

Access: Input-only

Type: Long

The number of columns in the table.

RowHeight

Access: Input-only

Type: Double

The height of the rows in the table.

ColWidth

Access: Input-only

Type: Double

The width of the columns in the table.

Return Value (RetVal)

Type: Table

The newly created table object.

Remarks

No additional remarks.

Examples

VBA:

Sub Example_AddTable()
    ' This example adds a table in model space

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As AcadTable
    Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)
    ZoomExtents

End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_AddTable()
    ;; This example adds a table in model space
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (setq pt (vlax-3d-point 0 0 0))

    (setq modelSpace (vla-get-ModelSpace doc))
    (setq MyTable (vla-Addtable modelSpace pt 5 5 10 30))
    (vla-ZoomExtents acadObj)
)