Notifications
Clear all

[Closed] dotnet datagridviewcellstyle weirdness

This is really messing with my head.
I’m trying to independently set two cellstyles, but even though I am defining two independent dotnet objects, when I change one, the other changes…

Have I discovered quantum entanglement within maxscript?

Run the following, the result is strange, changing ‘a’ backcolor, changes ‘b’ backcolor. But if I redefined ‘b’, then change ‘a’, the link appears broken, and I can change the colours without affecting the other.

What on earth am I doing wrong here?

a = dotnetobject “DataGridViewCellStyle”
b = dotnetobject “DataGridViewCellStyle”
a.tostring()
b.tostring()
a.backcolor = a.backcolor.black
a.tostring()
b.tostring()
b = dotnetobject “DataGridViewCellStyle”
a.backcolor = a.backcolor.white
a.tostring()
b.tostring()

2 Replies
 lo1

This seems to be a MAXScript specific issue. The same code run in c# works fine.

It’s interesting though, because I don’t see any caching mechanism in the mxs.net code.

Thanks Lo,
I’m glad to hear I’m not going mad!