How can I flush data recorder components with Metahopper?

I’d like to flush data recorder components with Metahopper because I’ve got a lot of monitoring to do on booleans that control data flow in my definition.
Getting bored clicking the “X” button at each go…
“Expire” doesn’t work as it just adds a “false” to the component’s output list.
I’ve tried “Set value” with a “False” boolean, it’s the same.
“Set value” with an empty list does nothing…

1 Like

Hi Osuire,

The script I’ve posted earlier probably originated from this thread:
I thought I did this myself but for that the code does look too similar :grinning_face_with_smiling_eyes:


You need to add this script component in a group with the DataRecorder components you want to control:

private void RunScript(bool recording, bool reset)
  var drs = FindDataRecsInCurrentGroup();
  foreach(GH_DataRecorder dr in drs)
    if (dr.RecordData != recording)
      dr.RecordData = recording;
  if (reset)
    foreach(GH_DataRecorder dr in drs)
// <Custom additional code> 
private List<GH_DataRecorder> FindDataRecsInCurrentGroup()
  var groups = GrasshopperDocument.Objects.OfType<GH_Group>().Where(gr => gr.ObjectIDs.Contains(Component.InstanceGuid)).ToList();
  var output = groups.Aggregate(new List<GH_DataRecorder>(), (list, item) =>
  Where(obj => item.ObjectIDs.Contains(obj.InstanceGuid)));
    return list;
  return output;
} (5.1 KB)


You guys are amazing !