Table SetBackgroundColorNone Variable

Table SetBackgroundColorNone Variable

Anonymous
Not applicable
272 Views
2 Replies
Message 1 of 3

Table SetBackgroundColorNone Variable

Anonymous
Not applicable
I have a Table that has every other row set to a color. I would like to set
every other row to background fill = none. this is what I found so far:

myTable.SetBackgroundColorNone y - 1, False

this command sets my table row to color white. does anyone know how to set
it to none.
0 Likes
273 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Nate,

You are using an incorrect method, for starters, and then if you *don't*
want a background, you need to use _True_ for the SetCellBackgroundColorNone
method's argument.

Sub Test()
Dim myTable As AcadTable
With ThisDrawing.ModelSpace
Set myTable = .Item(.Count - 1)
End With

Dim myColor As AcadAcCmColor
Set myColor = New AcadAcCmColor
myColor.ColorIndex = acRed

Dim i As Long, j As Long
For i = 0 To myTable.Rows - 1
If i Mod 2 = 1 Then
For j = 0 To myTable.Columns - 1
myTable.SetCellBackgroundColorNone i, j, False
myTable.SetCellBackgroundColor i, j, myColor
Next j
Else
For j = 0 To myTable.Columns - 1
myTable.SetCellBackgroundColorNone i, j, True
Next j
End If
Next i
End Sub


--
R. Robert Bell


"Nate Hunter" wrote in message
news:5105348@discussion.autodesk.com...
I have a Table that has every other row set to a color. I would like to set
every other row to background fill = none. this is what I found so far:

myTable.SetBackgroundColorNone y - 1, False

this command sets my table row to color white. does anyone know how to set
it to none.
0 Likes
Message 3 of 3

Anonymous
Not applicable
thanks that did the trick


"R. Robert Bell" wrote in message
news:5109446@discussion.autodesk.com...
Nate,

You are using an incorrect method, for starters, and then if you *don't*
want a background, you need to use _True_ for the SetCellBackgroundColorNone
method's argument.

Sub Test()
Dim myTable As AcadTable
With ThisDrawing.ModelSpace
Set myTable = .Item(.Count - 1)
End With

Dim myColor As AcadAcCmColor
Set myColor = New AcadAcCmColor
myColor.ColorIndex = acRed

Dim i As Long, j As Long
For i = 0 To myTable.Rows - 1
If i Mod 2 = 1 Then
For j = 0 To myTable.Columns - 1
myTable.SetCellBackgroundColorNone i, j, False
myTable.SetCellBackgroundColor i, j, myColor
Next j
Else
For j = 0 To myTable.Columns - 1
myTable.SetCellBackgroundColorNone i, j, True
Next j
End If
Next i
End Sub


--
R. Robert Bell


"Nate Hunter" wrote in message
news:5105348@discussion.autodesk.com...
I have a Table that has every other row set to a color. I would like to set
every other row to background fill = none. this is what I found so far:

myTable.SetBackgroundColorNone y - 1, False

this command sets my table row to color white. does anyone know how to set
it to none.
0 Likes