Big VB component (involuntarily) runs in a loop

unhandled

#1

Hello,

I have a VB component with many inputs, writing a Word document through *Microsoft.Office.Interop.Word" DLL (1).
Sometimes, the program runs in loop : it doesn’t stop after the Word document written, but it creates another Word document, again and again.

My hypothesis : The GH definition is re-evaluated (even if i don’t see why) while the VB component execution is not over.

What do you think ?

__

(1)
https://discourse.mcneel.com/t/interop-with-word-and-excel/53773/2


Button on/off staying on
#2

That it will be very difficult to debug with that many inputs, and that you might consider separating your concerns to reduce complexity here, perhaps to a minimal working example that demonstrates the bug (also, remember to provide files).


(David Rutten) #3

Things that cause a new solution under normal circumstances include:

  • UI events (slider drags, button clicks, key presses).
  • Referenced geometry being changed in Rhino (this is usually due to UI events as well).
  • The timer object.
  • The Data Dam object.
  • The File Reader object, or any other Import style component which uses a synchronised file path input, this includes the Image Sampler.
  • Galapagos or some other solver that sits ‘on top of’ Grasshopper.
  • Meta components or script components that deal with the state of Grasshopper, instead of just dealing with their own state.

If you have any of the above, that’s where you should start looking. And, like @AndersDeleuran said, until you provide a minimal example which still replicates the problem, you’ll in all likelihood have to look on your own.

I do not have Word btw. so for me to even run this minimal reproducible file it would have to not include that.


#4

Can you please share the definition (cleared of non essential variables if possible)? I do have Word and can try to reproduce.


#5

The bug is random on my computer, more frequent on my colleague’s one.

It’s difficult to extract the relevant part of the definition without keeping everything, but your answers helped me to delemit the bug :

The VB component is launched from a Human UI interface, with a toggle button. With “data recorder” plug-in i just noticed that the component was sending ‘True’ 2 times in a row (so the Word document is generated two times)… Can’t reproduce the infinite loop for now…


Toggle button send its value more than one time