VB.net - Create components on canvas and redraw at each step

Hi everybody, I wrote a vb.net scriptable component that creates objects on the canvas (sliders, expressions, panels) and connects them properly.
The only thing is that the whole bunch of components are drawn at the same time, i.e. I can only see the final result.

I am wondering if there is a way to force a redraw/update for each component that is created, so that one can see the process happening, rather than only the final result.

I looked on the forums for a similar thing, (related to geometry showing in rhino viewport) but it seems that it is not that easy since any redraw/update for such components is fired only when the solution completes (except for kangaroo of course).

Am I missing something?

Thanks for your help!

In the end I managed to make it happen using some static variables (because I first had to create the parameters/components and in a following cycle I connected them together) and using a trigger in order to update the component. But I reverted to the “one-shot” way, with only the final situation update.

Now I have two more “issues” and I would appreciate very much if someone could help understand:

  1. the wires created are orange and also the panels are not “receiving” the data until I change something (e.g. toggle the boolean that triggers the creation to “false”) or force a recompute from gh GUI, so this is fixed easily, but it would be still interesting to know the reason why this happens

  2. the expressions I created do not update themselves when I change the sliders. The panels do update, but not the expressions. Look a this example:
    I start from this condition:


    when I change the slider only the panel that is direclty connected to it updates, but not the following expression:
    image

This one is solved by saving, closing and re-opening the document.

The above is happening both using the GH_Document.AddObject (self-creating attributes etc. before adding) and the GH_Canvas.InstantiateNewObject.

No big deal, since it is solvable with workarounds, but I am afraid that what I wrote “works” for pure fortune and is not how it should be done.

Cheers!