# Dynamic group movement

**URL:** <https://forum.inductiveautomation.com/t/dynamic-group-movement/101423>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 27, 2025, 1:18pm UTC](https://forum.inductiveautomation.com/t/dynamic-group-movement/101423 "2025-01-27T13:18:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nassim\_Mellak](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nassim\_Mellak](https://forum.inductiveautomation.com/u/Nassim_Mellak)\
**Post date:** [January 27, 2025, 1:18pm UTC](https://forum.inductiveautomation.com/t/dynamic-group-movement/101423/1 "2025-01-27T13:18:11Z")

</div>

Hello ,  
I'd like to know how to modify the X and Y position dynamically in relation to an int tag in a group containing text and shapes.  
thank you.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 27, 2025, 1:21pm UTC](https://forum.inductiveautomation.com/t/dynamic-group-movement/101423/2 "2025-01-27T13:21:32Z")

</div>

Hi, and welcome to the forum! 🙂

Is this for vision or perspective? The question hints at vision, but it's good to be on the same page.

---

<div class="post-metadata">

**Author:** ![Nassim\_Mellak](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nassim\_Mellak](https://forum.inductiveautomation.com/u/Nassim_Mellak)\
**Post date:** [January 27, 2025, 1:52pm UTC](https://forum.inductiveautomation.com/t/dynamic-group-movement/101423/3 "2025-01-27T13:52:43Z")

</div>

Hello ,  
thank you for the welcome  
yes it's for Vision

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [January 27, 2025, 2:34pm UTC](https://forum.inductiveautomation.com/t/dynamic-group-movement/101423/4 "2025-01-27T14:34:45Z")

</div>

This doc might be helpful for you:

> **[system.gui.transform | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-gui/system-gui-transform)**
>
> Sets a component's position and size at runtime.

---

<div class="post-metadata">

**Author:** ![Nassim\_Mellak](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nassim\_Mellak](https://forum.inductiveautomation.com/u/Nassim_Mellak)\
**Post date:** [January 28, 2025, 7:30am UTC](https://forum.inductiveautomation.com/t/dynamic-group-movement/101423/5 "2025-01-28T07:30:57Z")

</div>

Thank you,  
but where do I write this code to animate the group?

---

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [January 28, 2025, 10:43am UTC](https://forum.inductiveautomation.com/t/dynamic-group-movement/101423/6 "2025-01-28T10:43:43Z")

</div>

If you want the code to update whenever a tag value is updated then I'd recommend you create a custom prop on your component (group, container, etc) then bind your tag or a timer to the property.

 ![custom property on your component](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/d/ad5b19a84e0e3b50aef9461e9a3a13decc7bd007.png)

Then on the component use code like this on the **propertyChange** event handler script on the component:

 ![propertyChange event handler script menu on your component.](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/d/dd214d74e2354479f40ce8d328da370c16bea056.png)

```python
# Easier for repeatability you can also have multiple properties move this component
def moveComponent(xPosition, yPosition):

	DURATION = 500 # Duration is in ms, if left blank then the transform will happen straight away.

	system.gui.transform(event.source, newX=xPosition, newY=yPosition, duration=DURATION)

if event.propertyName == "customPropName1":

	# Get your x and y values here and assign them to a variable (can be done by reading a tag, etc).
	x = 100
	y = 100
 
	moveComponent(x, y)

elif event.propertyName == "customPropName2":

	# Get your x and y values here and assign them to a variable (can be done by reading a tag, etc).
	x = 110
	y = 110
 
	moveComponent(x, y)

```

Hopefully this helps!

---

<div class="post-metadata">

**Author:** ![Nassim\_Mellak](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nassim\_Mellak](https://forum.inductiveautomation.com/u/Nassim_Mellak)\
**Post date:** [January 28, 2025, 10:53am UTC](https://forum.inductiveautomation.com/t/dynamic-group-movement/101423/7 "2025-01-28T10:53:04Z")

</div>

Thank you,  
it worked
