I have a document that looks like this:
%
O0001
( DIAMETER = 4. )
( CORNER RADIUS = .125 )
( STOCK ALLOWANCE = .03 )
G91 G28 Z0
H0 G49
T1
M6
G90
M3 S2500
G5 P1
G61.1
G0 X8.6251 Y-2.1484
G43 Z-1.4 H1 M50
Z-1.9
G1 Z-1.93 F150.
Y8.0004 Z-1.9831
X2.5551 Z-2.0149........say 10 more PAGES of this.
N200 ( T2 )
( DIAMETER = 1.5 )
( CORNER RADIUS = .125 )
( STOCK ALLOWANCE = .03 )
G91 G28 Z0
H0 G49
T2
M6
G90
M3 S2500
G5 P1
G61.1
X-5.875 Y.1278
G43 Z-1.4 H2 M50
Z-1.9
G1 Z-2.0349.....another 10 pages of this
This repeats many more times. The parenthesis sections are the start of a new toolpath and there could be up to 25 in one document with the document being anywhere from 10-1000 pages long.
I am looking for help creating a macro that would print the first 30 lines, starting with the parenthesis section, then have a couple blank lines, then the last ten lines before the next section. This would be page 1. Then page two would start with the second parenthesis section and 20 lines, # of blank lines, last ten lines to make up page two. i would like this to go on for as many toolpaths that are on the document.
I would like the output to look like this:
( DIAMETER = 4. )
( CORNER RADIUS = .125 )
( STOCK ALLOWANCE = .03 )
G91 G28 Z0
H0 G49
T1
M6
G90
M3 S2500
G5 P1
G61.1
G0 X8.6251 Y-2.1484
G43 Z-1.4 H1 M50.. (I would like the first 30 lines)
(4 carriage returns to represent a break)
X8.6251 Y-.1012 (last ten lines of this section)
Y8.0004
X1.375
G3 X.7405 Y6.4686 R.8973
G2 X1.375 Y4.9369 R2.1663
G0 Z-1.4
X-5.875 Y.1278
G5 P0
M01
-----------(page break here)
N200 ( T2 )
( DIAMETER = 1.5 )
( CORNER RADIUS = .125 )
( STOCK ALLOWANCE = .03 )
G91 G28 Z0
H0 G49
T2
M6
G90
M3 S2500
G5 P1
G61.1
X-5.875 Y.1278(up to 30 lines)
X8.6251 Y-.1012(last ten lines)
Y8.0004
X1.375
G3 X.7405 Y6.4686 R.8973
G2 X1.375 Y4.9369 R2.1663
G0 Z-1.4
X-5.875 Y.1278
G5 P0
M01
-----------(page break here)etc.
I have an excel macro that does this but would like it in word and can't get it to work in word. I asked someone else about this and they said the excel macro is totally different so I figured I wouldn't post it. If anyone would like to see it just ask.
If anyone could help, it would be greatly appreciated.
%
O0001
( DIAMETER = 4. )
( CORNER RADIUS = .125 )
( STOCK ALLOWANCE = .03 )
G91 G28 Z0
H0 G49
T1
M6
G90
M3 S2500
G5 P1
G61.1
G0 X8.6251 Y-2.1484
G43 Z-1.4 H1 M50
Z-1.9
G1 Z-1.93 F150.
Y8.0004 Z-1.9831
X2.5551 Z-2.0149........say 10 more PAGES of this.
N200 ( T2 )
( DIAMETER = 1.5 )
( CORNER RADIUS = .125 )
( STOCK ALLOWANCE = .03 )
G91 G28 Z0
H0 G49
T2
M6
G90
M3 S2500
G5 P1
G61.1
X-5.875 Y.1278
G43 Z-1.4 H2 M50
Z-1.9
G1 Z-2.0349.....another 10 pages of this
This repeats many more times. The parenthesis sections are the start of a new toolpath and there could be up to 25 in one document with the document being anywhere from 10-1000 pages long.
I am looking for help creating a macro that would print the first 30 lines, starting with the parenthesis section, then have a couple blank lines, then the last ten lines before the next section. This would be page 1. Then page two would start with the second parenthesis section and 20 lines, # of blank lines, last ten lines to make up page two. i would like this to go on for as many toolpaths that are on the document.
I would like the output to look like this:
( DIAMETER = 4. )
( CORNER RADIUS = .125 )
( STOCK ALLOWANCE = .03 )
G91 G28 Z0
H0 G49
T1
M6
G90
M3 S2500
G5 P1
G61.1
G0 X8.6251 Y-2.1484
G43 Z-1.4 H1 M50.. (I would like the first 30 lines)
(4 carriage returns to represent a break)
X8.6251 Y-.1012 (last ten lines of this section)
Y8.0004
X1.375
G3 X.7405 Y6.4686 R.8973
G2 X1.375 Y4.9369 R2.1663
G0 Z-1.4
X-5.875 Y.1278
G5 P0
M01
-----------(page break here)
N200 ( T2 )
( DIAMETER = 1.5 )
( CORNER RADIUS = .125 )
( STOCK ALLOWANCE = .03 )
G91 G28 Z0
H0 G49
T2
M6
G90
M3 S2500
G5 P1
G61.1
X-5.875 Y.1278(up to 30 lines)
X8.6251 Y-.1012(last ten lines)
Y8.0004
X1.375
G3 X.7405 Y6.4686 R.8973
G2 X1.375 Y4.9369 R2.1663
G0 Z-1.4
X-5.875 Y.1278
G5 P0
M01
-----------(page break here)etc.
I have an excel macro that does this but would like it in word and can't get it to work in word. I asked someone else about this and they said the excel macro is totally different so I figured I wouldn't post it. If anyone would like to see it just ask.
If anyone could help, it would be greatly appreciated.