How to determine what is at a particular cursor location
Attached is a sample file. They are groups of X & Y coordinates. These groups seem to be bracketed between ";PATH:" and "G00 Z4.^pA0." I'm having trouble conceptualizing an approach to a DO-WHILE to perform operations between those two endpoints.
The file represents X, Y, Z, A, and C coordinates in a 5-Axis system. I need to switch the X and Y coordinates only. I need to switch the X and Y values and then move them back to their correct relative positions.
So X-1.8721 Y-1.5709 becomes X-1.5709 Y-1.8721
X-1.571
Y-20.3033 Z7.802 F80. A-.761
Y-19.7012 Z7.7895 A-1.525 C-3.776
Y-19.0993 Z7.769 A-2.288
Y-18.4977 Z7.7405 A-3.051
.
.
.
becomes
Y-1.571
X-20.3033 Z7.802 F80. A-.761
X-19.7012 Z7.7895 A-1.525 C-3.776
X-19.0993 Z7.769 A-2.288
X-18.4977 Z7.7405 A-3.051
.
.
.
Y1.571
X-20.3033 Z7.802 F80. A-.761 C-90.
X-19.7012 Z7.7895 A-1.525 C-93.776
X-19.0993 Z7.769 A-2.288
X-18.4977 Z7.7405 A-3.051
X-17.8965 Z7.704 A-3.813
.
.
.
Becomes
X1.571
Y-20.3033 Z7.802 F80. A-.761 C-90.
Y-19.7012 Z7.7895 A-1.525 C-93.776
Y-19.0993 Z7.769 A-2.288
Y-18.4977 Z7.7405 A-3.051
Y-17.8965 Z7.704 A-3.813
.
.
.
|