SetColumnName Method (ActiveX)

Sets a name to a column.

Supported platforms: Windows only

Signature

VBA:

object.SetColumnName nIndex, name
object

Type: Table

The object this method applies to.

nIndex

Access: Input-only

Type: Long

The index of the column.

name

Access: Input-only

Type: String

The new name.

Return Value (RetVal)

No return value.

Remarks

No additional remarks.

Examples

VBA:

Sub Example_ColumnName()
     ' This example adds a table in model space and sets and gets a column name

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.ModelSpace
    Dim pt(2) As Double
    Dim MyTable As AcadTable
    Dim cName As String
    Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)
    
    Call MyTable.SetColumnName(2, "Test Name")
    MsgBox "The column name is: " & vbCrLf & _
           MyTable.GetColumnName(2)

    ZoomExtents
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ColumnName()
    ;; This example adds a table in model space and sets and gets a column name
    (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-SetColumnName MyTable 2 "Test Name")
    (alert (strcat "The column name is: \n"
                   (vla-GetColumnName MyTable 2)))

    (vla-ZoomExtents acadObj)
)