CellManipulation Example

Using Programming Languages other than VBA

Sub Example_CellManipulation()
	 ' 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 IAcadTable2
	Dim cName As String
	Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)

	Call MyTable.SetCellDataType(2, 2, acLong, acUnitDistance)
	Call MyTable.SetCellFormat(1, 3, "testFormat")
	Call MyTable.SetCellState(4, 3, acCellStateContentLocked)
	Call MyTable.SetCellValue(1, 4, 5)

	MsgBox MyTable.GetCellValue(1, 4) & " is the test cell's value "

	ZoomExtents

End Sub

 

   Comments?