# Blinking Rectangle

**URL:** <https://forum.inductiveautomation.com/t/blinking-rectangle/87222>\
**Category:** Ignition\
**Tags:** scripting, vision\
**Created:** [March 12, 2024, 9:33pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222 "2024-03-12T21:33:06Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [March 12, 2024, 9:33pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/1 "2024-03-12T21:33:06Z")

</div>

Hi, I have a dropdown menu with various values and I would like different rectangles to blink on a map depending on the value that has been chosen on the dropdown box. I'm not entirely sure how I would code this in scripting. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 12, 2024, 11:06pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/2 "2024-03-12T23:06:23Z")

</div>

Step 1: Tag your question as `vision` or `perspective`!

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [March 13, 2024, 12:16pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/3 "2024-03-13T12:16:19Z")

</div>

The correct answer for a dropdown in the Vision module will be completely different from the correct answer for a dropdown in the Perspective module. For this reason, you will have to let us know which module you are developing with in order to get the appropriate answer.

---

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [March 13, 2024, 2:52pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/4 "2024-03-13T14:52:25Z")

</div>

I'm new to Ignition so I'm unsure what this means, but maybe this helps? For reference, I want the various orange rectangles to blink depending on the number selected.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/5/25df9beeca36d7688b7474ed03661d84f2516c92.jpeg)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [March 13, 2024, 3:21pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/5 "2024-03-13T15:21:44Z")

</div>

thats in image? i dont think you can just magically do that on an image  
ah or is it the "rectangles" above the image?

---

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [March 13, 2024, 3:30pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/6 "2024-03-13T15:30:26Z")

</div>

I want the Rectangles 1-7 to blink, not the image files.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [March 13, 2024, 3:32pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/7 "2024-03-13T15:32:35Z")

</div>

> [@victordcq](#):
>
> thats in image?

This is Vision, and the rectangles are path based Vision shapes with a background property that can be made to blink. Does the blinking needs to be synchronous?

---

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [March 13, 2024, 3:36pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/8 "2024-03-13T15:36:05Z")

</div>

Not synchronous. I want all the rectangles to be hidden and ONLY show when a number is selected from the drop down menu

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 13, 2024, 3:55pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/9 "2024-03-13T15:55:33Z")

</div>

> [@Mia\_Galatis](#):
>
> I'm new to Ignition so I'm unsure what this means,

Ignition has two HMI / user interface modules.

- One is called "Vision" and creates stand-alone Java-based clients that are installed on a HMI PC.
- The other is "Perspective" and is web based. A web browser is the client and the Ignition gateway is the web server.

---

<div class="post-metadata">

**Author:** ![Bushmatic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bushmatic/32/87014_2.png) [@Bushmatic](https://forum.inductiveautomation.com/u/Bushmatic)\
**Post date:** [March 13, 2024, 3:57pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/10 "2024-03-13T15:57:01Z")

</div>

If I'm understanding the problem right, you'll basically just want to bind your "visible" property on each rectangle in a way that returns "false" unless the corresponding label(s) is selected on your dropdown menu.

You could add a custom property on each rectangle that matches the location name (like each rectangle would have a custom property called "Location", and this could equal "209" for one of those rectangles). Then make "visible" true when the selected label of the dropdown is equal to the custom Location property.

This all depends on the current configuration of those rectangles and how scalable you want this system to be.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/d/cd1513b751cdca1fe8d5847c9fb24a9039724fa5.jpeg)

> **[Inductive University Course List - Learn Ignition Free](https://inductiveuniversity.com/courses/ignition/vision-components-and-property-bindings/8.1)**
>
> Learn the fundamentals and advanced features of Ignition while earning your IU credential

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [March 13, 2024, 4:19pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/11 "2024-03-13T16:19:15Z")

</div>

Out of curiosity, what version of Ignition is this?

---

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [March 13, 2024, 4:34pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/12 "2024-03-13T16:34:14Z")

</div>

This is version 7.9

---

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [March 13, 2024, 4:36pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/13 "2024-03-13T16:36:36Z")

</div>

Ahh I see, so will this script be written for each individual rectangle? My initial through process was to write one long script that will just call upon each rectangle by name. Also how do I make it blink? Where does the timer component come into play?

---

<div class="post-metadata">

**Author:** ![Bushmatic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bushmatic/32/87014_2.png) [@Bushmatic](https://forum.inductiveautomation.com/u/Bushmatic)\
**Post date:** [March 13, 2024, 5:31pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/14 "2024-03-13T17:31:05Z")

</div>

Yes -- you could write a script on the propertyChange event of the dropdown menu that looks at the newly selected value, checks all of the rectangles, and sets visibility to true wherever it finds one that matches, but that's not something I would do. I try to avoid property change scripts because I have found them to be not 100% reliable, plus this will introduce some amount of lag for the user whenever they change the dropdown menu's selected value. The script will have to execute every time and iterate through the rectangles.

One binding (not necessarily a script -- this could be an expression or property binding in your case) for each rectangle would be preferable in my opinion. That way it's more like the rectangles are "pulling" information from the dropdown menu on an as-needed basis, rather than the dropdown menu "pushing" information out to everything at every change.

For the blinking, you would just need 1 timer component and 1 more set of bindings on your rectangles. For example, you could bind the fill paint property (on each rectangle) to the timer's value in a way that sets the color to full transparent and back to its semi-transparent yellow color repeatedly as the timer value updates. Maybe the timer's bound is just set to 1, so it repeatedly flips from 0 to 1 (corresponding to full-transparent and translucent yellow, respectively) on a schedule based on your delay value (default delay time is 1 second -- you may want your blinking to be a little faster than that, etc...). To save on performance you could ensure the timer is only running (i.e. its property "Running?" is set to "true") when there is at least 1 rectangle visible on the screen.

---

<div class="post-metadata">

**Author:** ![gilles.levesque](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@gilles.levesque](https://forum.inductiveautomation.com/u/gilles.levesque)\
**Post date:** [March 18, 2024, 7:23pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/15 "2024-03-18T19:23:46Z")

</div>

I would simply do this expression on each rectangle Visible Property  
{Root Container.Dropdown.selectedValue}=209  
using a different number for each rectangle.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [March 19, 2024, 12:16am UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/16 "2024-03-19T00:16:39Z")

</div>

> [@gilles.levesque](#):
>
> do this expression on each rectangle

That's a lot of expressions. Perhaps the rectangle should be templatized and possibly rendered with a repeater, so any future changes that are needed can be made one place. This would probably reduce development time as well.

---

<div class="post-metadata">

**Author:** ![gilles.levesque](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@gilles.levesque](https://forum.inductiveautomation.com/u/gilles.levesque)\
**Post date:** [March 19, 2024, 1:03pm UTC](https://forum.inductiveautomation.com/t/blinking-rectangle/87222/17 "2024-03-19T13:03:23Z")

</div>

Yes, a Template would make thing even easier
