CellClass Example

Using Programming Languages other than VBA

Sub Example_CellClasses()
' This example creates a TableStyle object and sets values for
	' the style classes and formatting.

	Dim dictionaries As AcadDictionaries
	Set dictionaries = ThisDrawing.Database.dictionaries
	Dim dictObj As AcadDictionary
	Set dictObj = dictionaries.Item("acad_tablestyle")
	' Create the custom TableStyle object in the dictionary
	Dim keyName As String
	Dim className As String
	Dim customObj As IAcadTableStyle2
	keyName = "NewStyle"
	className = "AcDbTableStyle"
	Set customObj = dictObj.AddObject(keyName, className)

	customObj.Name = "NewStyle"
	customObj.Description = "New Style for My Tables"
	customObj.CreateCellStyle ("NewTestStyle")
	Dim cellTestFormat As String

	Call customObj.SetCellClass("NewTestStyle", 4)

	Call customObj.SetRotation("NewTestStyle", 8.4)

	MsgBox "The cell class is " & customObj.GetCellClass("NewTestStyle") & _
			 " the cell rotation is " & customObj.GetRotation("NewTestStyle")
End Sub