Data dam toggle/trigger

I’m using the kinect component project owl, it constantly reads the kinect and outputs new point cloud, but I only need new data when I need it, so I’m using a data dam and it works great.
But the problem is i have to click the data damn manually, I’m wondering if it’s possible to trigger it with code/components.
For example, I’m reading an integer value from a file, and if the file is equal to a specific value, new data is let thru the data damn.
I see that there’s a timer for data damn, but the interval of when i need new data isn’t constant.

I’m quite sure it’s a data dam :wink:

And maybe you can use the Gate component for this to switch paths dependent on the input.

1 Like

Are you referring to a stream gate?
Owl will constantly output new data, but I only need one instant the data to be persistent, and only update to a new instance when trigger, so if I use a stream gate, wouldn’t it’d end up empty when not trigger?

I’ve found the solution here:

Yes, it would be nice to have a ‘trigger’ input for Data Dam. But I don’t agree that either of the proposals in the thread you refer to are a solution.

  • The one in using VB Script appears to trigger all data dams?
  • The one using Metahopper appears to be more selective using its “Get objects in group” feature but it’s a little obscure. The connection is only “explicit” in the sense that Data Dam and ObjFromGroup (and only those two components?) must be in the same group, a condition that is easily broken by accident. Besides, installing Metahopper for this feature alone isn’t worth it to me.

It would be best if the trigger is an event rather than a condition (“an integer value from a file is equal to a specific value”). Events don’t really exist in GH while a condition could be true thousands of times.

And there is serious flaw with Data Dams, mentioned a few days ago by @ivelin.peychev in another thread: they leak and pass data once when a GH file is opened! Very bad. :man_facepalming:

You don’t need Python since Stream Gate does the same thing:

data_dam_2019Jul20a (7.4 KB)

However… two things:

  1. To replicate multiple inputs supported by Data Dam (like Merge, Entwine and similar components), you have to either use multiple ‘Stream Gates’ activated by the same toggle (best solution) or Entwine first and BANG! (Explode Tree) after a single Stream Gate. (14.9 KB)

  2. Gates are not data dams since they don’t retain their values after the trigger event. Adding a data dam after the gate doesn’t solve that problem either (I tried it). This is an important difference. Data Recorder after the gate is tempting but highly problematic.

Conclusion: Gates solve the dam leak problem (pun intended) but don’t offer the same functionality in terms of multiple streams and more importantly, data retention.


All this puts back on the table the issue with all those components that require manual triggering inside Grasshopper.
So 2007…

1 Like

Event-driven Javascript apps had revolutionized the web by 2007.

Well, I mean that this was pre-Human UI.
It it wasn’t for Metahopper or other types of hacks, many components could not be triggered from a UI “outside” the canvas.

I’m struggling with this exact same problem.
I have a whole area of my definition that I want to “Refresh” only on demand, but I can find no way to retain the data AND replace it by fresh data through a trigger.

I tried fooling around with the “Record” component and a gate filter, but setting the “data limit” to 1 means that only one item goes through from every list.
I thought that it would only retain the last data “flow”, or last TREE, which would make this component actually useful !

@osuire @Joseph_Oster
I made a very simple C# component that solves this problem in the easiest way. Meaning you allow the pass of data or not by a trigger, and if the trigger is off, then the last data will be output.

(If you wish to delay the pass of the information when the trigger is on, you can simply use the data dam component and set the time in it to the interval you prefer, but the data will still only pass if the trigger is on.) (12.6 KB)

1 Like

Hi Heba,

Thanks for looking into this.
I started a separate thread on this subject (naughty me).

There is an issue with those C# scripts : they un-reference referenced geometry :

It turns out that using Metahopper does the trick !


I just read this, because I needed one of these, and then I made myself a clustered version. Here it is so folks can just drag and drop.

Data Dam with (13.8 KB)

1 Like