Grasshopper Components: How to force custom attributes to re-render

Hello, I have developed a custom component that can increment and decrement with buttons on the component via a CreateAttribues() override. The output value is displayed on the component itself and accurately updates with each button click. However, I also have normal inputs to adjust the starting value and step size. The problem is I cannot get the on-component display to update when I change these values.

  • I tried calling this.ExpireSolution(false) and for an “object expired during a solution” error.
  • I also tried a delegate action that calls Owner.OnDisplayExpired(false) in the custom attributes class, which seems to do nothing.

The display writes the value to the component display in the Render method of the custom attributes. How can I force the component to rerender with the updated input value?


Ok I solved it!
I gave the aforementioned Delegate Action in the attributes class an input, which was the value I wanted to display, and in that method I set the value in the custom attributes class to that input value. The Delegate is called in the Component class during SolveInstance(). That is how I was able to pass the value from the Component class to the Attributes class. I am still a bit confused about the OnDisplayExpired() behavior, but as long as it’s working, right!!??