# Force Y Position to be static in Vision

**URL:** <https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [April 2, 2024, 4:11pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242 "2024-04-02T16:11:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Dacek](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nick\_Dacek](https://forum.inductiveautomation.com/u/Nick_Dacek)\
**Post date:** [April 2, 2024, 4:11pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/1 "2024-04-02T16:11:19Z")

</div>

Guys, I'm struggling here. First job with Ignition, potentially more to come, but it just falls flat on it's face with animation which is big in the industry I'm in.

I have a coil (red circle) as it grows, I want the line to follow it.  
I've already written my own python routine to normalize data coming in and scaling it to pixels. (Feature request btw, every other HMI lets you set the range on an animation)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/8/980c1456b555c4ee3e5e95157ce5f9b4c31f55f3.png)

I have created custom properties that scale my coil diameter and translate it to the line. It adjusts x, y, height, width, and angle.

Y, actually does not need adjusted. All my math seems to check out. If I enter my max diameter, my red circle grows to it's max, and the line, IF it would stay in the proper position in the Y, would actually work. Instead I get this  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/921acacc97dec809ebd45e1d5952f3dbdc434cee.png)

Mind you, my Y position, is actually tied to a custom property which is giving me the value the line needs to be at  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5fa42fab647bbed17715b99933c585b2a6b5a48.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/778d3e520ea73c5aaed055343c9d81bd133d5f49.png)  
StripYPos is calculated to be 405, which is what Y **SHOULD** be displaying. Instead Its at 430  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/8/18becdca328b54010596a063a84ee4b61d2607c7.png)  
It just gets ignored by Vision.

Any ideas? Customer isn't going to be happy if we can't figure this one out.

---

<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:** [April 2, 2024, 4:23pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/2 "2024-04-02T16:23:33Z")

</div>

Instead of trying to manually align lines (which is only going to end in frustration), considering using a Paintable Canvas component to draw your lines, circles, etc:

> **[Vision - Paintable Canvas | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/vision-components/misc/paintable-canvas)**
>
> The Paintable Canvas component is a component that can be custom painted using Jython scripting.

This is basically your best bet in terms of _animation_ specifically within Vision.

---

<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:** [April 2, 2024, 4:28pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/3 "2024-04-02T16:28:20Z")

</div>

What is happening to the y position as the diameter approaches max? Does it look ok all the way up until the max is reached, and then suddenly jumps down to the wrong spot?

---

<div class="post-metadata">

**Author:** ![Nick\_Dacek](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nick\_Dacek](https://forum.inductiveautomation.com/u/Nick_Dacek)\
**Post date:** [April 3, 2024, 3:44pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/4 "2024-04-03T15:44:54Z")

</div>

The y position is always just wrong. As other things calculate and move, the Y increases.

It shouldn't. I want it to stay static. I've keyed it in manually, it changes. Ive done an expression that basically states, y=405

And yet as the other parameters change, exactly as they should, the Y changes. If it would stay static, i'd be in good shape

---

<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:** [April 3, 2024, 3:55pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/5 "2024-04-03T15:55:59Z")

</div>

> [@Nick\_Dacek](#):
>
> basically states, y=405

If Y is supposed to be static, why the expression?

---

<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:** [April 3, 2024, 4:16pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/6 "2024-04-03T16:16:26Z")

</div>

Y of the floating line should always be the y position of the horizontal line.

---

<div class="post-metadata">

**Author:** ![Nick\_Dacek](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nick\_Dacek](https://forum.inductiveautomation.com/u/Nick_Dacek)\
**Post date:** [April 3, 2024, 4:27pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/7 "2024-04-03T16:27:48Z")

</div>

Was just trying ideas to see something stick. Ignition just keeps changing it.  
Is there a way to make it static?

---

<div class="post-metadata">

**Author:** ![Nick\_Dacek](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nick\_Dacek](https://forum.inductiveautomation.com/u/Nick_Dacek)\
**Post date:** [April 3, 2024, 4:28pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/8 "2024-04-03T16:28:07Z")

</div>

Agreed.

Why does it keep changing?

---

<div class="post-metadata">

**Author:** ![Nick\_Dacek](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nick\_Dacek](https://forum.inductiveautomation.com/u/Nick_Dacek)\
**Post date:** [April 3, 2024, 4:30pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/9 "2024-04-03T16:30:19Z")

</div>

I put this as my Y, changed my coil diameter, and the Y position changed on its own

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

---

<div class="post-metadata">

**Author:** ![Nick\_Dacek](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nick\_Dacek](https://forum.inductiveautomation.com/u/Nick_Dacek)\
**Post date:** [April 3, 2024, 4:30pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/10 "2024-04-03T16:30:56Z")

</div>

I do not see properties for the center/anchor point of an object?

---

<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:** [April 3, 2024, 4:32pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/11 "2024-04-03T16:32:37Z")

</div>

Bind the y of the floating line to the y of the horizontal line.  
Bind x to the centerline of the circle.

Here'a window to play with.  
[test\_coil\_2024-04-03\_1231.zip](https://forum.inductiveautomation.com/uploads/short-url/yYslDD3cQQ7AZzZnxLRfpEN99fm.zip) (7.4 KB)

---

<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:** [April 3, 2024, 4:33pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/12 "2024-04-03T16:33:56Z")

</div>

Do not adjust the angle.

---

<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:** [April 3, 2024, 4:47pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/13 "2024-04-03T16:47:49Z")

</div>

> [@JordanCClark](#):
>
> adjust the angle.

Sorry, got called out the shop floor. Adjusting the angle changes the x and y positions. Recipe for  
a headache, as you've already seen.

However, if you draw a line at an angle the endpoints are in the opposite corners of the box that bounds it, and the angle is zero.

From there you only need to adjust the height. X / Y / Width stays constant.

---

<div class="post-metadata">

**Author:** ![Nick\_Dacek](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nick\_Dacek](https://forum.inductiveautomation.com/u/Nick_Dacek)\
**Post date:** [April 3, 2024, 5:38pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/14 "2024-04-03T17:38:26Z")

</div>

Good call. Will attempt it this way

---

<div class="post-metadata">

**Author:** ![Dustin\_VanKeuren](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dustin\_VanKeuren](https://forum.inductiveautomation.com/u/Dustin_VanKeuren)\
**Post date:** [November 20, 2024, 3:23pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/15 "2024-11-20T15:23:23Z")

</div>

I would be interested in the end result for both the coil and the line if you don't mind sharing. I have the same requirement.

---

<div class="post-metadata">

**Author:** ![Dustin\_VanKeuren](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dustin\_VanKeuren](https://forum.inductiveautomation.com/u/Dustin_VanKeuren)\
**Post date:** [November 20, 2024, 6:10pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/16 "2024-11-20T18:10:25Z")

</div>

This is what I ended up doing:  
Inside the coil template I calculate the difference between the max coil diameter and the current coil diameter whenever the diameter changes. I added a custom property to the floating line to define its default height, which is the height of the line when the coil is at its max size. Then I linked the height of the floating line to that difference variable from the coil template. The link runs an expression where I set the floating line height = (the default height + the coil difference) / 2

---

<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:** [November 20, 2024, 6:20pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/17 "2024-11-20T18:20:31Z")

</div>

This will work, right up until the clients resolution and/or scaling changes, and then it will break.

Use a Paintable Canvas really.

---

<div class="post-metadata">

**Author:** ![Dustin\_VanKeuren](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Dustin\_VanKeuren](https://forum.inductiveautomation.com/u/Dustin_VanKeuren)\
**Post date:** [November 21, 2024, 12:35pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/18 "2024-11-21T12:35:49Z")

</div>

We don't allow resolution changes and I should not have to manually draw simple things like this. Might as well use a real HMI at that point, or visual studio for that matter.

---

<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:** [November 21, 2024, 3:09pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/19 "2024-11-21T15:09:41Z")

</div>

> [@Dustin\_VanKeuren](#):
>
> I should not have to manually draw simple things

This is a valid point. I too get frustrated with shapes sometimes because their x, y, width, and height are all zero and getting their relative bounds to play nice with conventional components can get convoluted. It would be awesome if we could get both absolute and relative bounds on the shape components, even if the absolute bounds were not bindable.

That said, my favorite component, by a lor, is the paintable canvas. I love using them as glass panes to add unlimited functionality to any window, and while I have no doubt that what you've done works fine, I can say that I wouldn't hesitate to use a canvas for something like this instead of dynamic shapes.

---

<div class="post-metadata">

**Author:** ![Nick\_Dacek](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@Nick\_Dacek](https://forum.inductiveautomation.com/u/Nick_Dacek)\
**Post date:** [November 21, 2024, 7:08pm UTC](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242/20 "2024-11-21T19:08:33Z")

</div>

I don't have the project in front of me but, basically, i setup custom properties in the base of the page that computed the numbers i needed for x, y, height, width. Then tied those expressions to my objects.  
I also had python scripts that would scale from physical numbers to screen pixels and the proper ratio.

It was alot of work to be honest. Something that normally took me about a minute in other HMI's turned into a whole project in itself. Then I had to show the customer why so many hours were spent and yeah. Nobody was happy.

Unfortunately given the nature of ignition, its communications, and having to constantly compute these numbers, updates were painfully slow compared to FactoryTalk, Citect, Wonderware, etc...There was some noticeable lag, even after getting support involved.

[Next page](https://forum.inductiveautomation.com/t/force-y-position-to-be-static-in-vision/88242.md?page=2)
