Here is a snippet of my code going through a list of ObjRefs and trying to change object color
// selected is an array of ObjRef
foreach (int i in ri)
{
selected[i].Object().Attributes.ColorSource = ObjectColorSource.ColorFromObject;
selected[i].Object().Attributes.ObjectColor = colorDialog1.Color;
if (!selected[i].Object().CommitChanges()) MessageBox.Show("didn't happen");
}
How would I debug when that CommitChanges() call returns false? BTW no exception thrown at all…
A bit more background is that the variable “selected” is an ObjRef[] assigned to a class variable of a winforms UserControl. “ri” is just a list of int. I click a button and it calls up a winforms ColorDialog. if result is ok, assign that color to all these objects.
Thank you much!
I have suspected that. I hope McNeel team sees this. In any case, they could possibly build in some kind of intellisense that says I cannot make calls right off of the Object() method. No sure what the exact programming term for it is but I’ve run into this before, where VS told me I shouldn’t do the call in-line. Or maybe I was in IronPython accessing the .NET SDK. It would throw an exception.