# Need Help with Key Plan script

**URL:** <https://forum.dynamobim.com/t/need-help-with-key-plan-script/107365>\
**Category:** Revit\
**Tags:** dynamo\
**Created:** [January 21, 2025, 1:51am UTC](https://forum.dynamobim.com/t/need-help-with-key-plan-script/107365 "2025-01-21T01:51:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahmadPWH7D](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@mahmadPWH7D](https://forum.dynamobim.com/u/mahmadPWH7D)\
**Post date:** [January 21, 2025, 1:51am UTC](https://forum.dynamobim.com/t/need-help-with-key-plan-script/107365/1 "2025-01-21T01:51:47Z")

</div>

Trying to get my sheets to first turn off all key plans then turn on key plan area depending on what letter the sheet ends with. I got the first half figured out, but now I’m stuck. I think the next step is to separate the sheets by the letter they end in but I cant figure it out. First time writing a script.

 ![Key Plan](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/2/627cf8f980b522002d72bb1a710918f353a4945d.png)

---

<div class="post-metadata">

**Author:** ![Kai](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kai](https://forum.dynamobim.com/u/Kai)\
**Post date:** [January 21, 2025, 5:05am UTC](https://forum.dynamobim.com/t/need-help-with-key-plan-script/107365/2 "2025-01-21T05:05:42Z")

</div>

Hi @mahmadPWH7D Welcome to the community  
Here’s a rough example that may be of use, blue groups will need to be modified based on your use case.

[GenericExample.dyn](https://forum.dynamobim.com/uploads/short-url/kDeHWInon55RCSKaT5hsMufyFvQ.dyn) (44.2 KB)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/d/3dc35d05d479e7f8ca524e78c59c8070f5a415ef.png)

 ![example01](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/f/ef104f71e46dc8563e0102d1575ff946236deec3.png)  
Cheers KS
