How do I call this function with a button?

Hi, I found an old topic with your problem check this out

Based on that topic the above image may be the result.