How can I make height of a rectangle change from top instead of bottom dynamically

I am trying to do a animation of a lift table and to do that I have made a rectangle which changes value respective to the distance of my sensor.

The issue is that the height changes from bottom and the top of the rectangle remains stationary.

I have tried what ever I was able to find but not able to lock the bottom of the rectangle.

Any ideas?

Vision or perspective?

1 Like

height change ignition

I am not sure of that. What I mean as shown in the picture I drawn, dynamically the height changes from bottom to top depending on the height value, what I require is to be changing from top to bottom keeping the bottom fixed.

You're not sure if you're developing in Vision or Perspective?

I ask, because there will be a big difference in the way you approach this problem, depending on what platform you are designing for.

Sorry my bad its Vision.


Create a custom property to hold the height for the component.

Then in a property change script you will need to use system.gui.transform() to transform the rectangle with the calculated top position.

Since the position of the component is the top left corner you will need to calculate the difference between the top position of the rectangle at full range and the new top at the given height. Done correctly and the bottom should remain fixed where you have placed it.

1 Like

Hi Rose,

Thank for the help and reply. I am having difficulty in calculating the absolute height.

system.gui.transform(component=event.source, newY=(100/event.source.relHeight))

As per my understanding if the height decreases the Y should increase relatively but I am not able to find an expression for that.

Any ideas?

I really appreciate your help on this.

I would make sure you specify to use the coordSpace=system.gui.COORD_DESIGNER so that it works for clients of different sizes.

I think you might struggle with the symbol if it animates frequently. You might find it slowly wander off the page due to pixel inaccuracies in the transform calculation. Eventually these will make differences to the return position which will gradually move the home position until its off the page altogether.
Scratch that. It won't float away if you use fixed positions, which is more than likely what you would use. If you were animating rotation then this is a known issue. Things like fan propellers will fly away into the ether when rotating


Use coordSpace = 1 when using relative coordinates such as relX and relY to keep transformations relative to the designer.
Use coordSpace = 0 [or don't specify since this is the default] when using absolute coordinates such as x or y.

1 Like

Thank you everyone for your help especially Rose. I was finally able to get my animation of lift table as I wanted. It lifts up and down according to the distance sensor's value.