Square Drawing Tool

Good day. There’s a custom tool called “Pitchfork Drawing Tool” by Alexander that uses the coding attribute “infinite” so that lines extend with the chart without the user having to manually extend them. I’ve been trying to code the same “infinite” attribute into a rectangle drawing tool, with no luck. Has anyone already done something like this or can anyone help with this? Thanks