# Moving Component Position with a Tag

**URL:** <https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [December 18, 2024, 2:48pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985 "2024-12-18T14:48:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Lino](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@Jose\_Lino](https://forum.inductiveautomation.com/u/Jose_Lino)\
**Post date:** [December 18, 2024, 2:48pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/1 "2024-12-18T14:48:24Z")

</div>

Hi everyone,

I’m trying to move a component to fixed coordinates (x=100, y=100) when a tag (or property) named `Vendor` becomes True.

I know that it is a simple code, but I don't know why it's not working.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f743048e5736827c69b6fe9487c1f2952ef5d965.png)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [December 18, 2024, 3:29pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/2 "2024-12-18T15:29:50Z")

</div>

The script you’ve shown is only checking that the property which changed is Vendor. Not that its value changed to True.

---

<div class="post-metadata">

**Author:** ![Jose\_Lino](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@Jose\_Lino](https://forum.inductiveautomation.com/u/Jose_Lino)\
**Post date:** [December 18, 2024, 4:18pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/3 "2024-12-18T16:18:25Z")

</div>

Thank you for the help! What would be the correct command or approach to recognize when the property becomes true?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 18, 2024, 4:22pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/4 "2024-12-18T16:22:52Z")

</div>

```python
if event.propertyName == 'Vendor':
    if event.newValue:
        system.gui.transform(event.source, 100, 100)

```

---

<div class="post-metadata">

**Author:** ![Jose\_Lino](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@Jose\_Lino](https://forum.inductiveautomation.com/u/Jose_Lino)\
**Post date:** [December 18, 2024, 4:40pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/5 "2024-12-18T16:40:59Z")

</div>

Thanks! It is still not working.

I tried to print the event.newValue, but I don't see anything in the console, so the command is not being executed.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/2/82a63084a72306b538d775a4339fa07581b91d25.png)

To give a little bit more context, the object that I am trying to move is a Valve template. I don't know if this information is needed.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 18, 2024, 4:52pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/6 "2024-12-18T16:52:51Z")

</div>

Add a line to print what property changes _ **are** _ firing. If you don't see `Vendor` print then that is your problem.

```python
print event.propertyName
if event.propertyName == 'Vendor':
    ...

```

---

<div class="post-metadata">

**Author:** ![Jose\_Lino](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@Jose\_Lino](https://forum.inductiveautomation.com/u/Jose_Lino)\
**Post date:** [December 18, 2024, 6:24pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/7 "2024-12-18T18:24:58Z")

</div>

It is not printing anything, so maybe I'm doing other things wrong.

I have the custom property "Vendor", and a few template properties, so it should print at least something right?

I am looking at the Output Console, but maybe I need to look somewhere else?

I am sorry, I am just getting expertise in scripting in Ignition.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [December 18, 2024, 6:32pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/8 "2024-12-18T18:32:28Z")

</div>

> [@Jose\_Lino](#):
>
> It is not printing anything, so maybe I'm doing other things wrong.

It should definitely print something in the output console.

Show us how you have set up your template, and how you set up your custom property.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 18, 2024, 6:37pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/9 "2024-12-18T18:37:01Z")

</div>

Also, if you're testing property change events in the Designer, you must activate 'preview mode' -- property change events are not fired while in design mode.

---

<div class="post-metadata">

**Author:** ![Jose\_Lino](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@Jose\_Lino](https://forum.inductiveautomation.com/u/Jose_Lino)\
**Post date:** [December 18, 2024, 6:51pm UTC](https://forum.inductiveautomation.com/t/moving-component-position-with-a-tag/99985/10 "2024-12-18T18:51:09Z")

</div>

Thanks Everyone for the help! It worked.

I had another script that was causing the problem, so this script never executed.

And indeed, I didn't know that I needed to activate the preview mode.
