Connecting a button to "Set One Line" command in HumanUI

I’m trying to add a button on my HumanUI window which should function as when pressed, it should let me draw a line in Rhino just like when you right click on Line component in Grasshopper and click Set One Line. I’ve used the Pick Object script that I’ve found from here but it only works with a created object. Is there a way to make this work without an existing line? (17.6 KB)