The following is a sample of how you can do it. Load the script and enter "CCSgetPoints()" in ciw. Draw a few lines in a layout and press Enter to terminate.
The script actually has a problem in that it is quite inflexible in terms of changing the input layers. Would you like to improve on it and post your solution so that everybody can benefit from it? Perhaps you might want to consider using "@rest" keyword
in CCSgetPoints procedure to allow user to enter the desired layers.
?prompts list("Enter first point" "Enter next point(s)")
procedure( CCSdraw(win done allPoints)
if( done then
dbCreatePolygon(cv list("Metal1" "drawing") allPoints)
dbCreatePolygon(cv list("Metal2" "drawing") allPoints)
dbCreatePolygon(cv list("Metal3" "drawing") allPoints)