This is first stage 1 of an overall endgame...the endgame is to save a whole heap of time meddling about with indexing dowel pins so that my prior etched pcb is aligned accurately & can be depaneled (the inspiration was this video -
http://www.youtube.com/watch?v=JJnenOsbCzU&feature=player_embedded - but he's using his own cnc software)
At the minute, here's what I'm doing wrt making pcbs...
Etch a pcb (with known index marks) - drill the index marks out with a 3mm drill (not easy due to human parallax error)
proceed to cnc machine.....load a drill file to drill 3mm holes at the known index marks.
Pop some dowel pins into the drill holes
Now place the pcb over the pins - board is now aligned (maybe - see above re parallax errors!)- pcb board 'outline' cutout can begin
For all it reads quick...it's time consuming!
where I want to get to....
Etch a pcb with known index marks (no need to drill them out)
proceed to cnc machine....clamp board down roughly (ie doesn't need to be accurately aligned)
Run macro - align webcam over 1st index mark (no parallax error)....cnc machine now knows say 0,0 (which your earlier code will do nicely for)
Ok, this is the bit I haven't mentioned but is step 2 (have to nail tha few simpler macros first ...so hence the softly softly approach to this)
Now we have 0,0 sorted ......move to another known coordinate with the webcam - and Mach3 the works out the angle of rotation.
pcb outline cutout can begin.
So I'm eliminating a few time intensive steps (drilling out the pcb, drilling some dowl pin holes, placing in dowel pins, etc) & potential for parallax errors by loosely clamping the pcb & then having a webcam & couple of webcam alignment macros do the legwork.
But like I say, I'm new to VB scripts (and G-Code come to that)...so my initial step is a tool tip view...where I can jump to where the tool was located & back again (with maybe some jogging about to align in between - hence wanting the 'wait until use presses CR' question which started off this thread)