Dynamic Length Variable Updates with geometric changes in Rhino

hello,
I am developing a Python program that, upon launching, will draw hatched zones (which is easy for now). However, each zone will correspond to a variable ‘length’. I would like the length variable to update in real-time whenever the length of the zone is modified by moving controls points. The problem I’m facing in this program is creating the link between the length of the zone and the variable. How can I implement this logic? For those familiar with Tkinter, the ‘.bind()’ function is somewhat related to the idea I have.

thanks!