It is not possible to script the level dimensions (that I know of).
The best I can think of would be to create an object (that can tell you the placed elevation height if you need it to) that you can place with the gravity tool - but this will only determine the height of one point.
You could then have a stretchy hotspot for the other point that you would have to manually adjust.
Of course the gravity will not link to the initial elements so any changes would require manual adjustment.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11