Here is OC functin which should do the job:
void change_rect_fill(string strName = "Rect")
{
GraphLayer gl = Project.ActiveLayer();
GraphObject go = gl.GraphObjects(strName);
Tree tr;
tr.Root.Border.Width.dVal = 0; // no border
tr.Root.Fill.Color.nVal = INDEX_COLOR_TRANSPARENT; // no fill color
tr.Root.Fill.Pattern.Style.nVal = 3; // sparse diagonal
tr.Root.Fill.Pattern.Width.dVal = 1; // pattern width
tr.Root.Fill.Pattern.PatternColor.nVal = 0; // black pattern color
int err = go.UpdateThemeIDs(tr.Root, "Error", "Unknown tag");
go.ApplyFormat(tr, true, true);
}
It is based on theme properties access.