# Cancel gh based on part of result/errors?

**URL:** <https://discourse.mcneel.com/t/cancel-gh-based-on-part-of-result-errors/119836>\
**Category:** Grasshopper\
**Created:** [March 6, 2021, 6:12pm UTC](https://discourse.mcneel.com/t/cancel-gh-based-on-part-of-result-errors/119836 "2021-03-06T18:12:24Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![AndersDeleuran](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andersdeleuran/32/476683_2.png) [@AndersDeleuran](https://discourse.mcneel.com/u/AndersDeleuran)\
**Post date:** [May 2, 2026, 11:02am UTC](https://discourse.mcneel.com/t/cancel-gh-based-on-part-of-result-errors/119836/7 "2026-05-02T11:02:36Z")

</div>

> [@kike](#):
>
> … like a Data Dam that you can programmatically expire conditionally …

I was surprised that one just needs to literally expire a DataDam to pass data through it. So for a pre-Rhino 9 solution, a script like this one should do the trick:

> [@Toggle Data Dam](https://discourse.mcneel.com/t/toggle-data-dam/190183/5):
>
> It looks like one just needs to expire a data dam to pass data through it (i.e. simply recomputing a definition will also work). Here’s a quick GhPython script that appears to work as expected. I usually target specific components on canvas via their NickName when using this coding pattern (i.e. iterating all components on canvas by type, followed by nick name). But it doesn’t seem possible to edit this directly on data dams, so here I’m targeting by names of the first input parameter instead: …

---

_[View the full topic](https://discourse.mcneel.com/t/cancel-gh-based-on-part-of-result-errors/119836)._
