Routing Control Points coordinates

I'm really new in programming.

I'd like to create a code where the user is able to select routing control points and get printed individual XYZ coordinates.

My idea was to create a points matrix with the selected control points. The coordinates Will be show up in a tabulated format in groups every time user clics "OK"

Does anybody have a similar code I can use to modify?

I realy appreciate your help.