How do you transform just the height of a cuboid using code?

Hi All I am wanting to create a button for an escape room. When the cuboid is clicked, shrinks in height (mimicking a button) without changing the width or depth. I have had a look at the transform code blocks but it seems to on allows the scaling of the object. any ideas?

With Coblocks… I guess you cannot adjust only height.

But you can use Typscript or Python to change only height of cuboid.

Here is API: Cuboid class - Delightex API

I made a sample for you.

You can try.

Great thank you for this - to be honest, I was too focussed on trying to solve it with blocks that it didn’t occur for me to look at Python. I appreciate the quick response.