# System.gui.transform error trying to resize container

**URL:** <https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252>\
**Category:** Ignition\
**Created:** [March 9, 2021, 8:09am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252 "2021-03-09T08:09:34Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 9, 2021, 8:09am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/1 "2021-03-09T08:09:34Z")

</div>

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

i am trying to resize the container width when i drag the line . its working

but when i drag the line. **line is not visible** i don’t know where i am making mistake.

can any one check the video and script and give correct solution.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 9, 2021, 8:41am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/2 "2021-03-09T08:41:48Z")

</div>

Is the line you’re dragging part of the ‘Dial Template’ that you’re making wider?

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 9, 2021, 8:43am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/3 "2021-03-09T08:43:48Z")

</div>

no its not part of it . **dial template is actually a container**

line is belong to root container

can you give correct script for this issue

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 9, 2021, 8:50am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/4 "2021-03-09T08:50:44Z")

</div>

You’re transforming the Dial Template only, you’re not moving the line, so it’s staying still. You can see it still there in the gaps. You need to transform the line as well

 ![20210309_192002](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/a/dafbde864cc35f8714a564747ec15735f864e7ad.jpeg)

---

<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:** [March 9, 2021, 11:32am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/6 "2021-03-09T11:32:50Z")

</div>

```python
line = event.source
component = event.source.parent.getComponent('Dial Template')

mouseX = event.x
lineX = line.getX()
lineY = line.getY()

newComponentWidth = component.width + mouseX
newLineX = lineX + mouseX

system.gui.transform(component, newwidth = newComponentWidth, duration = 10)
system.gui.transform(line, newLineX, lineY, duration = 10)
```

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 9, 2021, 11:44am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/7 "2021-03-09T11:44:50Z")

</div>

its not working wrongly when i press the line ( Dial template container expands to same range)

i just what to drag the line and want the container to expand

i have pasted your script in mouse dragged

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/92eda3b229c873d82e98560dbe3aa72d2f02206b.png)

is there anything to change?

**whether i have to put the line inside the (dial template container)???**

i don’t want line to scale upwards . i want move sides only

---

<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:** [March 9, 2021, 11:48am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/8 "2021-03-09T11:48:11Z")

</div>

Here’s the window I developed against.

[dragTest\_2021-03-09\_0646.zip](https://forum.inductiveautomation.com/uploads/short-url/6SjvYmGCOSoeB6BWSZnzzmfHw55.zip) (3.4 KB)

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 9, 2021, 11:53am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/9 "2021-03-09T11:53:15Z")

</div>

yes its working i checked i will use this. thanks for your support

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 9, 2021, 8:34pm UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/12 "2021-03-09T20:34:51Z")

</div>

You should have all the code you need, you just need to apply the same concepts to the other container

---

<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:** [March 11, 2021, 5:00pm UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/14 "2021-03-11T17:00:37Z")

</div>

This example

- will calculate by the margins between the line and other components
- has margins as limits to not run beyond the component locations

[DragTest2.zip](https://forum.inductiveautomation.com/uploads/short-url/urWiyVW6ic8P2MnPsBS7Kpkla22.zip) (3.8 KB)

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 12, 2021, 4:00am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/15 "2021-03-12T04:00:09Z")

</div>

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

script working fine for margin control for not run beyond the component locations . but still space between **(left side container and line) and (right side container and line is not equal)**. i have executed your script in client

this is the issue i am facing spacing between container and line is not equal

---

<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:** [March 12, 2021, 10:22am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/16 "2021-03-12T10:22:02Z")

</div>

You’ll need to take the width of your line component into account, and adjust your math accordingly.

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 12, 2021, 10:35am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/17 "2021-03-12T10:35:13Z")

</div>

yes i have hard coded the value its working fine

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [March 26, 2021, 6:39pm UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/18 "2021-03-26T18:39:26Z")

</div>

One dobut scripting is working fine but right container size is vary depending upon the windows size (example HD display and for Full HD display) size of the container changing.  
I tired anchoring and relative both not working properly.

How to automatic resize the conatiner width and position depends upon the window size?

Whether I need to get window size and do some calculation?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 27, 2021, 12:59am UTC](https://forum.inductiveautomation.com/t/system-gui-transform-error-trying-to-resize-container/44252/19 "2021-03-27T00:59:02Z")

</div>

Try setting the coordinate space of the transform function to use the Designer space. The default is the screen coords which will stuff up your values.  
E.g.

```auto
system.gui.transform(...., coordSpace=system.gui.COORD_DESIGNER)

```
