import win32com.client
from win32com.client import constants as C
propName = "TheProperty"
gridDataName = "TheGrid"
siProperty = Application.ActiveSceneRoot.AddProperty( "CustomProperty", False, propName )
gridData = siProperty.AddGridParameter(gridDataName).Value
gridData.ColumnCount = 3
gridData.RowCount = 3
for row in range( 3 ):
gridData.SetRowLabel( row, "Row %d"%row )
for col in range ( 3 ):
if row == 1:
gridData.SetColumnLabel( col, "Col %d"%col )
gridData.SetCell( col, row, "%d,%d"%( col, row ) )
Application.InspectObj( siProperty )
# Set third row background color to Blue
color = gridData.GetCellBackgroundColor( 0, 2 )
color.Red = 0
color.Green = 0
color.Blue = 255
for col in range(3):
gridData.SetCellBackgroundColor( col, 2, color ) |