Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add Notes and stock size to Post

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
reeltime273
372 Views, 8 Replies

Add Notes and stock size to Post

Hello All,

 

I also have wanted to add set up notes to my post,  it will make it easier for me while at my machine.   I have tried to add this information but have been unsuccessful, however and have been able to include post time a a few generic notes, this is all that I can get to work.  I have tried to copy and paste into my post what others have suggested, however,  the post will not load into Fusion or it fails to to post on the Visual Studio Code (VSC).   In the notes I would like to include stock size, material, info on where to zero part and anything else that others can suggest.   I have included a good working post.  For my machine, I utilize a generic Mach3 Mill post that I downloaded from fusion 360, which I also have included.  Please let me know if I need to provide any additional info.   

 

Thanks in advance for some guidance!

Mark, 

8 REPLIES 8
Message 2 of 9
aju_augustine
in reply to: reeltime273

Hi @reeltime273 ,

 

To add Stock Size, you can add the codes in your post as shown below. For clarity, I have added original and modified codes below:

 

Original:

 

  writeComment(localize("POST GENERATED ON") + " " + now.toLocaleDateString() + " " + now.toLocaleTimeString());  // ADDED 04.09.2024 BY MB 
  
  
  writeln(" ");
  writeComment(programComment);
  writeProgramHeader();

 

Modified:

  writeComment(localize("POST GENERATED ON") + " " + now.toLocaleDateString() + " " + now.toLocaleTimeString());  // ADDED 04.09.2024 BY MB 
  var workpiece = getWorkpiece();
  var delta = Vector.diff(workpiece.upper, workpiece.lower);
  writeComment(" Stock dimension X = " + xyzFormat.format(delta.x) + " ");
  writeComment(" Stock dimension Y = " + xyzFormat.format(delta.y) + " ");
  writeComment(" Stock dimension Z = " + xyzFormat.format(delta.z) + " ");
  writeln(" ");
  writeComment(programComment);
  writeProgramHeader();

 

To add notes, you can add the codes in your post as shown below. 

 

Original:

 

properties.writeTools = {
  title      : "Write tool list",
  description: "Output a tool list in the header of the program.",
  group      : "formats",
  type       : "boolean",
  value      : true,
  scope      : "post"
};
function writeProgramHeader() {
  

  
  // dump machine configuration
  var vendor = machineConfiguration.getVendor();

 

Modified: 

 

properties.writeTools = {
  title: "Write tool list",
  description: "Output a tool list in the header of the program.",
  group: "formats",
  type: "boolean",
  value: true,
  scope: "post"
};
function writeProgramHeader() {
  if (hasGlobalParameter("job-notes")) {
    var notes = getGlobalParameter("job-notes");
    if (notes) {
      writeBlock("( -----SETUP NOTES----- )")
      var lines = String(notes).split("\n");
      var r1 = new RegExp("^[\\s]+", "g");
      var r2 = new RegExp("[\\s]+$", "g");
      for (line in lines) {
        var comment = lines[line].replace(r1, "").replace(r2, "");
        if (comment) {
          writeComment(comment);
        }
      }
      writeBlock("( --------------------- )")
    }
  }
  // dump machine configuration
  var vendor = machineConfiguration.getVendor();

 

The final output will look like the screenshot below. I hope this helps.

9.png

 



Aju Augustine
Technology Consultant
Message 3 of 9
reeltime273
in reply to: aju_augustine

Aju,

 

We are making progress, I was only able to capture the stock dimensions, this time I have included my set up sheet.  As you can see I have highlighted the stock in green.   Not sure why I'm not getting the rest of the setup notes,  I have highlighted them in red.   This is my output: 

 

(POST PROCESSOR: GENERIC MACH 3 MILL BY ARTSOFT)
(PROGRAMMED BY: MARK BATES)
(POST GENERATED ON MONDAY, APRIL 15, 2024 18:09:21)
( STOCK DIMENSION X = 6. )
( STOCK DIMENSION Y = 3. )
( STOCK DIMENSION Z = 0.25 )

(T1 D=0.1719 CR=0. TAPER=118DEG - ZMIN=-0.3016 - DRILL)
G90 G94 G91.1 G40 G49 G17
G20
G28 G91 Z0.
G90

(DRILL4)
T1 M6
S5000 M3
G17 G90 G94
G54
M7
G0 X0.875 Y1.5
G43 Z0.625 H1
G0 Z0.825
G98 G81 X0.875 Y1.5 Z-0.3016 R0.825 F39.4
X1.95
X4.05
X5.125
G80
Z0.625

M9
M5
G28 G91 Z0.
G90
G28 G91 X0. Y0.
G90
M30

 

Thanks for your help!

Message 4 of 9
aju_augustine
in reply to: reeltime273

Hi @reeltime273 ,

 

To get the rest of the setup notes, you can modify the codes in the post. Here are the original and modified codes for clarity:

 

Original:

 

  writeComment(localize("POST GENERATED ON") + " " + now.toLocaleDateString() + " " + now.toLocaleTimeString());  // ADDED 04.09.2024 BY MB 
  var workpiece = getWorkpiece();
  var delta = Vector.diff(workpiece.upper, workpiece.lower);
  writeComment(" Stock dimension X = " + xyzFormat.format(delta.x) + " ");
  writeComment(" Stock dimension Y = " + xyzFormat.format(delta.y) + " ");
  writeComment(" Stock dimension Z = " + xyzFormat.format(delta.z) + " ");
  writeln(" ");
  writeComment(programComment);
  writeProgramHeader();

 

 

Modified:

 

writeComment(localize("POST GENERATED ON") + " " + now.toLocaleDateString() + " " + now.toLocaleTimeString());  // ADDED 04.09.2024 BY MB 
  var workpiece = getWorkpiece();
  var delta = Vector.diff(workpiece.upper, workpiece.lower);
  writeComment(" Stock dimension X = " + xyzFormat.format(delta.x) + " ");
  writeComment(" Stock dimension Y = " + xyzFormat.format(delta.y) + " ");
  writeComment(" Stock dimension Z = " + xyzFormat.format(delta.z) + " ");
  var partX = getGlobalParameter("part-upper-x") - getGlobalParameter("part-lower-x")
  var partY = getGlobalParameter("part-upper-y") - getGlobalParameter("part-lower-y")
  var partZ = getGlobalParameter("part-upper-z") - getGlobalParameter("part-lower-z")
  writeComment(" Part dimension X = " + xyzFormat.format(partX) + " ");
  writeComment(" Part dimension Y = " + xyzFormat.format(partY) + " ");
  writeComment(" Part dimension Z = " + xyzFormat.format(partZ) + " ");
  writeComment(" Stock Lower in WCS X= " + xyzFormat.format(getGlobalParameter("stock-lower-x")) + " ");
  writeComment(" Stock Lower in WCS Y= " + xyzFormat.format(getGlobalParameter("stock-lower-y")) + " ");
  writeComment(" Stock Lower in WCS Z= " + xyzFormat.format((getGlobalParameter("stock-lower-z"))) + " ");
  writeComment(" Stock Upper in WCS X= " + xyzFormat.format((getGlobalParameter("stock-upper-x"))) + " ");
  writeComment(" Stock Upper in WCS Y= " + xyzFormat.format((getGlobalParameter("stock-upper-y"))) + " ");
  writeComment(" Stock Upper in WCS Z= " + xyzFormat.format((getGlobalParameter("stock-upper-z"))) + " ");

  writeln(" ");
  writeComment(programComment);
  writeProgramHeader();

 

 

After these modifications, the output will contain more detailed setup notes. You can see an example in the screenshot below.

 

_10.png

 

I hope this helps! 



Aju Augustine
Technology Consultant
Message 5 of 9
reeltime273
in reply to: aju_augustine

Post is starting to look as I imagined, couple of questions in the post, not sure if this data is coming from my Fusion 360 preference setups or directly from the post.   This is what I now get on output:

 

(PROGRAM NAME AND OPERATION: 1001)
(MACHINE MANUFACTURER: BRIDGEPORT SERIES 1)
(CNC PROGRAM: CNC_DC BY JIM DAWSON)
(CADCAM SOFTWARE: FUSION 360)
(POST PROCESSOR: GENERIC MACH 3 MILL BY ARTSOFT)
(PROGRAMMED BY: MARK BATES)
(POST GENERATED ON THURSDAY, APRIL 18, 2024 07:34:30)
( STOCK DIMENSION X = 6. )...........................Is there a setting to add trailing zeros to 2 places?
( STOCK DIMENSION Y = 3. )
( STOCK DIMENSION Z = 0.25 )    
( PART DIMENSION X = 127. ) ...........................Why am I getting mm on the part dimension and on inches on stock
( PART DIMENSION Y = 63.5 )                           dimensions?     
( PART DIMENSION Z = 6.35 )
( STOCK LOWER IN WCS X= 0. )
( STOCK LOWER IN WCS Y= 0. )
( STOCK LOWER IN WCS Z= -6.35 )
( STOCK UPPER IN WCS X= 152.4 ) .................. See question about part dimension.
( STOCK UPPER IN WCS Y= 76.2 )
( STOCK UPPER IN WCS Z= 0. )

(STOCK MATERIAL: ALUMINUM 6061, ZERO PART UPPER LEFT FRONT CORNER) ........Why am I getting comments 
(T1 D=0.1719 CR=0. TAPER=118DEG - ZMIN=-0.3016 - DRILL)                                          posted twice.  

(STOCK MATERIAL: ALUMINUM 6061, ZERO PART UPPER LEFT FRONT CORNER)
(T1 D=0.1719 CR=0. TAPER=118DEG - ZMIN=-0.3016 - DRILL)
G90 G94 G91.1 G40 G49 G17
G20
G28 G91 Z0.
G90

(DRILL4)
T1 M6
S5000 M3
G17 G90 G94
G54
M7
G0 X0.875 Y1.5
G43 Z0.625 H1
G0 Z0.825
G98 G81 X0.875 Y1.5 Z-0.3016 R0.825 F39.4
X1.95
X4.05
X5.125
G80
Z0.625

M9
M5
G28 G91 Z0.
G90
G28 G91 X0. Y0.
G90
M30

 

Thanks again for your guidance and assistance.

Message 6 of 9
aju_augustine
in reply to: reeltime273

Hi @reeltime273 ,

 

I have checked your post,to rectify this issue, you can modify the codes (mentioned below) as per the attached screenshot:

 

_1.png

 

 

 

 

  writeComment("PROGRAM NAME AND OPERATION: " + programName);
  writeComment("MACHINE MANUFACTURER: " + "BRIDGEPORT SERIES 1")  // ADDED 04.09.2024 BY MB
  writeComment("CNC PROGRAM: " + "CNC_DC BY JIM DAWSON")  // ADDED 04.09.2024 BY MB
  writeComment("CADCAM SOFTWARE: FUSION 360")  // ADDED 04.09.2024 BY MB 
  writeComment("POST PROCESSOR: GENERIC MACH 3 MILL BY ARTSOFT")  // ADDED 04.09.2024 BY MB 
  writeComment("PROGRAMMED BY: MARK BATES")  // ADDED 04.09.2024 BY MB 
  writeComment(localize("POST GENERATED ON") + " " + now.toLocaleDateString() + " " + now.toLocaleTimeString());  // ADDED 04.09.2024 BY MB 
  var workpiece = getWorkpiece();
  var delta = Vector.diff(workpiece.upper, workpiece.lower);
  writeComment(" Stock dimension X = " + xyzFormat.format(delta.x) + " ");
  writeComment(" Stock dimension Y = " + xyzFormat.format(delta.y) + " ");
  writeComment(" Stock dimension Z = " + xyzFormat.format(delta.z) + " ");
  var partX = toPreciseUnit((getGlobalParameter("part-upper-x") - getGlobalParameter("part-lower-x")), MM);
  var partY = toPreciseUnit((getGlobalParameter("part-upper-y") - getGlobalParameter("part-lower-y")), MM);
  var partZ = toPreciseUnit((getGlobalParameter("part-upper-z") - getGlobalParameter("part-lower-z")), MM);
  writeComment(" Part dimension X = " + xyzFormat.format(partX) + " ");
  writeComment(" Part dimension Y = " + xyzFormat.format(partY) + " ");
  writeComment(" Part dimension Z = " + xyzFormat.format(partZ) + " ");
  writeComment(" Stock Lower in WCS X= " + xyzFormat.format(toPreciseUnit(getGlobalParameter("stock-lower-x"), MM)) + " ");
  writeComment(" Stock Lower in WCS Y= " + xyzFormat.format(toPreciseUnit(getGlobalParameter("stock-lower-y"), MM)) + " ");
  writeComment(" Stock Lower in WCS Z= " + xyzFormat.format(toPreciseUnit(getGlobalParameter("stock-lower-z"), MM)) + " ");
  writeComment(" Stock Upper in WCS X= " + xyzFormat.format(toPreciseUnit(getGlobalParameter("stock-upper-x"), MM)) + " ");
  writeComment(" Stock Upper in WCS Y= " + xyzFormat.format(toPreciseUnit(getGlobalParameter("stock-upper-y"), MM)) + " ");
  writeComment(" Stock Upper in WCS Z= " + xyzFormat.format(toPreciseUnit(getGlobalParameter("stock-upper-z"), MM)) + " ");

 

 

 

Comments were repeated twice because of duplication of codes mentioned in the screenshot as "Not needed".

According to the given format, if there are numbers following the decimal point, zeroes will be added until there are four decimal places in total. However, if there are no numbers after the decimal point, the number will be displayed as it is, without any extra zeroes

 

Output should look like the screenshot below:

 

_4.png

 

I hope this helps!

 

 



Aju Augustine
Technology Consultant
Message 7 of 9
reeltime273
in reply to: aju_augustine

It seems to be working as designed now, I see what you mean about the trailing zeros on setup.  I tried entering 4 zeros after the decimal, but it always reverted back to the whole number.  Is this normal operation for Fusion 360 or is this a setting I'm overlooking?  

 

(PROGRAM NAME AND OPERATION: 1001)
(MACHINE MANUFACTURER: BRIDGEPORT SERIES 1)
(CNC PROGRAM: CNC_DC BY JIM DAWSON)
(CADCAM SOFTWARE: FUSION 360)
(POST PROCESSOR: GENERIC MACH 3 MILL BY ARTSOFT)
(PROGRAMMED BY: MARK BATES)
(POST GENERATED ON THURSDAY, APRIL 18, 2024 18:26:20)
( STOCK DIMENSION X = 6. )
( STOCK DIMENSION Y = 3. )
( STOCK DIMENSION Z = 0.25 )
( PART DIMENSION X = 5. )
( PART DIMENSION Y = 2.5 )
( PART DIMENSION Z = 0.25 )
( STOCK LOWER IN WCS X= 0. )
( STOCK LOWER IN WCS Y= 0. )
( STOCK LOWER IN WCS Z= -0.25 )
( STOCK UPPER IN WCS X= 6. )
( STOCK UPPER IN WCS Y= 3. )
( STOCK UPPER IN WCS Z= 0. )

(STOCK MATERIAL: ALUMINIUM 6061, ZERO PART LEFT FRONT UPPER CORNER OR MATERIAL)
(T2 D=0.25 CR=0. - ZMIN=0.02 - FLAT END MILL)
G90 G94 G91.1 G40 G49 G17
G20
(WHEN USING FUSION FOR PERSONAL USE, THE FEEDRATE OF RAPID)
(MOVES IS REDUCED TO MATCH THE FEEDRATE OF CUTTING MOVES,)
(WHICH CAN INCREASE MACHINING TIME. UNRESTRICTED RAPID MOVES)
(ARE AVAILABLE WITH A FUSION SUBSCRIPTION.)
G28 G91 Z0.
G90

(2D POCKET2)
T2 M6
S2292 M3
G17 G90 G94
G54
M7
G0 X2.9136 Y1.4848
G43 Z0.6 H2
G1 Z0.2 F10.2
Z0.145 F3.4
X2.9128 Y1.484 Z0.1374 F10.2
X2.9105 Y1.4815 Z0.1306
X2.9071 Y1.4774 Z0.1251
X2.9031 Y1.472 Z0.1214
X2.8989 Y1.4657 Z0.12
G3 X3.1011 Y1.341 Z0.107 I0.1011 J-0.0624
X2.8989 Y1.4657 Z0.0939 I-0.1011 J0.0624
X3.1011 Y1.341 Z0.0809 I0.1011 J-0.0624
X2.8989 Y1.4657 Z0.0679 I-0.1011 J0.0624
X3.1011 Y1.341 Z0.0549 I0.1011 J-0.0624
X2.8989 Y1.4657 Z0.0418 I-0.1011 J0.0624
X3.1011 Y1.341 Z0.0288 I0.1011 J-0.0624
X3. Y1.5221 Z0.02 I-0.1011 J0.0624
G1 X2.9929
G3 X2.9801 Y1.5094 I0. J-0.0128
G1 Y1.4951
G3 X2.9929 Y1.4823 I0.0128 J0.
G1 X3.0071
G3 X3.0199 Y1.4951 I0. J0.0128
G1 Y1.5094
G3 X3.0071 Y1.5221 I-0.0128 J0.
G1 X3.
G2 X2.9805 Y1.5371 I0. J0.0202
G3 X2.9559 Y1.5365 I-0.0122 J-0.0033
G1 X2.9556 Y1.5338
Y1.4706
G3 X2.9684 Y1.4579 I0.0128 J0.
G1 X3.0316
G3 X3.0444 Y1.4706 I0. J0.0128
G1 Y1.5338
G3 X3.0316 Y1.5466 I-0.0128 J0.
G1 X2.9684
G3 X2.9559 Y1.5365 I0. J-0.0128
G2 X2.9427 Y1.5209 I-0.0213 J0.0046
G3 X2.9311 Y1.5039 I0.0068 J-0.017
G1 Y1.4461
G3 X2.9439 Y1.4334 I0.0128 J0.
G1 X3.0561
G3 X3.0689 Y1.4461 I0. J0.0128
G1 Y1.5583
G3 X3.0561 Y1.5711 I-0.0128 J0.
G1 X2.9439
G3 X2.9311 Y1.5583 I0. J-0.0128
G1 Y1.5039
G2 X2.9189 Y1.4855 I-0.0199 J0.
G3 X2.9067 Y1.4671 I0.0076 J-0.0184
G1 Y1.4217
G3 X2.9194 Y1.4089 I0.0128 J0.
G1 X3.0806
G3 X3.0933 Y1.4217 I0. J0.0128
G1 Y1.5828
G3 X3.0806 Y1.5956 I-0.0128 J0.
G1 X2.9194
G3 X2.9067 Y1.5828 I0. J-0.0128
G1 Y1.4671
G2 X2.8944 Y1.4488 I-0.0199 J0.
G3 X2.8822 Y1.4304 I0.0076 J-0.0184
G1 Y1.3972
G3 X2.895 Y1.3844 I0.0128 J0.
G1 X3.105
G3 X3.1178 Y1.3972 I0. J0.0128
G1 Y1.6073
G3 X3.105 Y1.62 I-0.0128 J0.
G1 X2.895
G3 X2.8822 Y1.6073 I0. J-0.0128
G1 Y1.4304
G2 X2.8699 Y1.4121 I-0.0199 J0.
G3 X2.8577 Y1.3937 I0.0076 J-0.0184
G1 Y1.3727
G3 X2.8705 Y1.3599 I0.0128 J0.
G1 X3.1295
G3 X3.1423 Y1.3727 I0. J0.0128
G1 Y1.6318
G3 X3.1295 Y1.6445 I-0.0128 J0.
G1 X2.8705
G3 X2.8577 Y1.6318 I0. J-0.0128
G1 Y1.3937
G2 X2.8455 Y1.3753 I-0.0199 J0.
G3 X2.8332 Y1.357 I0.0076 J-0.0184
G1 Y1.3482
G3 X2.846 Y1.3355 I0.0128 J0.
G1 X3.154
G3 X3.1668 Y1.3482 I0. J0.0128
G1 Y1.6562
G3 X3.154 Y1.669 I-0.0128 J0.
G1 X2.846
G3 X2.8332 Y1.6562 I0. J-0.0128
G1 Y1.357
G2 X2.8187 Y1.336 I-0.0224 J0.
G3 X2.8233 Y1.311 I0.0046 J-0.0121
G1 X3.1785
G3 X3.1913 Y1.3238 I0. J0.0128
G1 Y1.6807
G3 X3.1785 Y1.6935 I-0.0128 J0.
G1 X2.8215
G3 X2.8087 Y1.6807 I0. J-0.0128
G1 Y1.3238
G3 X2.8215 Y1.311 I0.0128 J0.
G1 X2.8233
G2 X2.8417 Y1.2987 I0. J-0.0199
G3 X2.86 Y1.2865 I0.0184 J0.0076
G1 X3.203
G3 X3.2157 Y1.2993 I0. J0.0128
G1 Y1.7052
G3 X3.203 Y1.718 I-0.0128 J0.
G1 X2.797
G3 X2.7843 Y1.7052 I0. J-0.0128
G1 Y1.2993
G3 X2.797 Y1.2865 I0.0128 J0.
G1 X2.86
G2 X2.8784 Y1.2743 I0. J-0.0199
G3 X2.8967 Y1.262 I0.0184 J0.0076
G1 X3.2274
G3 X3.2402 Y1.2748 I0. J0.0128
G1 Y1.7297
G3 X3.2274 Y1.7424 I-0.0128 J0.
G1 X2.7726
G3 X2.7598 Y1.7297 I0. J-0.0128
G1 Y1.2748
G3 X2.7726 Y1.262 I0.0128 J0.
G1 X2.8967
G2 X2.9151 Y1.2498 I0. J-0.0199
G3 X2.9335 Y1.2375 I0.0184 J0.0076
G1 X3.2519
G3 X3.2647 Y1.2503 I0. J0.0128
G1 Y1.7542
G3 X3.2519 Y1.7669 I-0.0128 J0.
G1 X2.7481
G3 X2.7353 Y1.7542 I0. J-0.0128
G1 Y1.2503
G3 X2.7481 Y1.2375 I0.0128 J0.
G1 X2.9335
G2 X2.9518 Y1.2253 I0. J-0.0199
G3 X2.9702 Y1.2131 I0.0184 J0.0076
G1 X3.2764
G3 X3.2892 Y1.2258 I0. J0.0128
G1 Y1.7786
G3 X3.2764 Y1.7914 I-0.0128 J0.
G1 X2.7236
G3 X2.7108 Y1.7786 I0. J-0.0128
G1 Y1.2258
G3 X2.7236 Y1.2131 I0.0128 J0.
G1 X2.9702
G2 X2.9885 Y1.2008 I0. J-0.0199
G3 X3.0069 Y1.1886 I0.0184 J0.0076
G1 X3.3009
G3 X3.3137 Y1.2014 I0. J0.0128
G1 Y1.8031
G3 X3.3009 Y1.8159 I-0.0128 J0.
G1 X2.6991
G3 X2.6863 Y1.8031 I0. J-0.0128
G1 Y1.2014
G3 X2.6991 Y1.1886 I0.0128 J0.
G1 X3.0069
G2 X3.0253 Y1.1763 I0. J-0.0199
G3 X3.0436 Y1.1641 I0.0184 J0.0076
G1 X3.3254
G3 X3.3381 Y1.1769 I0. J0.0128
G1 Y1.8276
G3 X3.3254 Y1.8404 I-0.0128 J0.
G1 X2.6746
G3 X2.6619 Y1.8276 I0. J-0.0128
G1 Y1.1769
G3 X2.6746 Y1.1641 I0.0128 J0.
G1 X3.0436
G2 X3.062 Y1.1519 I0. J-0.0199
G3 X3.0803 Y1.1396 I0.0184 J0.0076
G1 X3.3498
G3 X3.3626 Y1.1524 I0. J0.0128
G1 Y1.8521
G3 X3.3498 Y1.8648 I-0.0128 J0.
G1 X2.6502
G3 X2.6374 Y1.8521 I0. J-0.0128
G1 Y1.1524
G3 X2.6502 Y1.1396 I0.0128 J0.
G1 X3.0803
G2 X3.0987 Y1.1274 I0. J-0.0199
G3 X3.1171 Y1.1151 I0.0184 J0.0076
G1 X3.3743
G3 X3.3871 Y1.1279 I0. J0.0128
G1 Y1.8765
G3 X3.3743 Y1.8893 I-0.0128 J0.
G1 X2.6257
G3 X2.6129 Y1.8765 I0. J-0.0128
G1 Y1.1279
G3 X2.6257 Y1.1151 I0.0128 J0.
G1 X3.1171
G2 X3.1354 Y1.1029 I0. J-0.0199
G3 X3.1538 Y1.0907 I0.0184 J0.0076
G1 X3.3988
G3 X3.4116 Y1.1034 I0. J0.0128
G1 Y1.901
G3 X3.3988 Y1.9138 I-0.0128 J0.
G1 X2.6012
G3 X2.5884 Y1.901 I0. J-0.0128
G1 Y1.1034
G3 X2.6012 Y1.0907 I0.0128 J0.
G1 X3.1538
G2 X3.1721 Y1.0784 I0. J-0.0199
G3 X3.1905 Y1.0662 I0.0184 J0.0076
G1 X3.4233
G3 X3.436 Y1.079 I0. J0.0128
G1 Y1.9255
G3 X3.4233 Y1.9383 I-0.0128 J0.
G1 X2.5767
G3 X2.564 Y1.9255 I0. J-0.0128
G1 Y1.079
G3 X2.5767 Y1.0662 I0.0128 J0.
G1 X3.1905
G2 X3.2089 Y1.0539 I0. J-0.0199
G3 X3.2272 Y1.0417 I0.0184 J0.0076
G1 X3.4478
G3 X3.4605 Y1.0545 I0. J0.0128
G1 Y1.95
G3 X3.4478 Y1.9628 I-0.0128 J0.
G1 X2.5522
G3 X2.5395 Y1.95 I0. J-0.0128
G1 Y1.0545
G3 X2.5522 Y1.0417 I0.0128 J0.
G1 X3.2272
G2 X3.2456 Y1.0295 I0. J-0.0199
G3 X3.2639 Y1.0172 I0.0184 J0.0076
G1 X3.4722
G3 X3.485 Y1.03 I0. J0.0128
G1 Y1.9745
G3 X3.4722 Y1.9872 I-0.0128 J0.
G1 X2.5278
G3 X2.515 Y1.9745 I0. J-0.0128
G1 Y1.03
G3 X2.5278 Y1.0172 I0.0128 J0.
G1 X3.2639
G2 X3.2823 Y1.005 I0. J-0.0199
G3 X3.3006 Y0.9927 I0.0184 J0.0076
G1 X3.4967
G3 X3.5095 Y1.0055 I0. J0.0128
G1 Y1.9989
G3 X3.4967 Y2.0117 I-0.0128 J0.
G1 X2.5033
G3 X2.4905 Y1.9989 I0. J-0.0128
G1 Y1.0055
G3 X2.5033 Y0.9927 I0.0128 J0.
G1 X3.3006
G2 X3.319 Y0.9805 I0. J-0.0199
G3 X3.3374 Y0.9683 I0.0184 J0.0076
G1 X3.5212
G3 X3.534 Y0.981 I0. J0.0128
G1 Y2.0234
G3 X3.5212 Y2.0362 I-0.0128 J0.
G1 X2.4788
G3 X2.466 Y2.0234 I0. J-0.0128
G1 Y0.981
G3 X2.4788 Y0.9683 I0.0128 J0.
G1 X3.3374
G2 X3.3557 Y0.956 I0. J-0.0199
G3 X3.3741 Y0.9438 I0.0184 J0.0076
G1 X3.5457
G3 X3.5584 Y0.9566 I0. J0.0128
G1 Y2.0479
G3 X3.5457 Y2.0607 I-0.0128 J0.
G1 X2.4543
G3 X2.4416 Y2.0479 I0. J-0.0128
G1 Y0.9566
G3 X2.4543 Y0.9438 I0.0128 J0.
G1 X3.3741
G2 X3.3924 Y0.9315 I0. J-0.0199
G3 X3.4108 Y0.9193 I0.0184 J0.0076
G1 X3.5701
G3 X3.5829 Y0.9321 I0. J0.0128
G1 Y2.0724
G3 X3.5701 Y2.0852 I-0.0128 J0.
G1 X2.4299
G3 X2.4171 Y2.0724 I0. J-0.0128
G1 Y0.9321
G3 X2.4299 Y0.9193 I0.0128 J0.
G1 X3.4108
G2 X3.4292 Y0.9071 I0. J-0.0199
G3 X3.4475 Y0.8948 I0.0184 J0.0076
G1 X3.5946
G3 X3.6074 Y0.9076 I0. J0.0128
G1 Y2.0969
G3 X3.5946 Y2.1096 I-0.0128 J0.
G1 X2.4054
G3 X2.3926 Y2.0969 I0. J-0.0128
G1 Y0.9076
G3 X2.4054 Y0.8948 I0.0128 J0.
G1 X3.4475
G2 X3.4659 Y0.8826 I0. J-0.0199
G3 X3.4842 Y0.8703 I0.0184 J0.0076
G1 X3.6193
G3 X3.6319 Y0.883 I0. J0.0126
G1 Y2.1215
G3 X3.6193 Y2.1341 I-0.0126 J0.
G1 X2.3807
G3 X2.3681 Y2.1215 I0. J-0.0126
G1 Y0.883
G3 X2.3807 Y0.8703 I0.0126 J0.
G1 X3.4842
G2 X3.5013 Y0.859 I0. J-0.0184
G3 X3.5183 Y0.8477 I0.017 J0.0071
G1 X3.625
G3 X3.6546 Y0.8772 I0. J0.0296
G1 Y2.1272
G3 X3.625 Y2.1568 I-0.0296 J0.
G1 X2.375
G3 X2.3454 Y2.1272 I0. J-0.0296
G1 Y0.8772
G3 X2.375 Y0.8477 I0.0296 J0.
G1 X3.5183
G2 X3.5366 Y0.8354 I0. J-0.0199
G3 X3.555 Y0.8232 I0.0184 J0.0076
G1 X3.625
G3 X3.679 Y0.8772 I0. J0.054
G1 Y2.1272
G3 X3.625 Y2.1813 I-0.054 J0.
G1 X2.375
G3 X2.321 Y2.1272 I0. J-0.054
G1 Y0.8772
G3 X2.375 Y0.8232 I0.054 J0.
G1 X3.555
G2 X3.5733 Y0.811 I0. J-0.0199
G3 X3.5917 Y0.7987 I0.0184 J0.0076
G1 X3.625
G3 X3.7035 Y0.8772 I0. J0.0785
G1 Y2.1272
G3 X3.625 Y2.2058 I-0.0785 J0.
G1 X2.375
G3 X2.2965 Y2.1272 I0. J-0.0785
G1 Y0.8772
G3 X2.375 Y0.7987 I0.0785 J0.
G1 X3.5917
G2 X3.6114 Y0.7853 I0. J-0.0211
G3 X3.6314 Y0.7724 I0.0188 J0.0073
X3.73 Y0.8772 I-0.0064 J0.1048
G1 Y2.1272
G3 X3.625 Y2.2322 I-0.105 J0.
G1 X2.375
G3 X2.27 Y2.1272 I0. J-0.105
G1 Y0.8772
G3 X2.375 Y0.7722 I0.105 J0.
G1 X3.625
X3.6314 Y0.7724
X3.6352 Y0.773 Z0.0206
X3.6389 Y0.7741 Z0.0212
X3.6421 Y0.7756 Z0.023
X3.645 Y0.7775 Z0.0248
X3.6471 Y0.7793 Z0.0275
X3.649 Y0.7813 Z0.0303
X3.6511 Y0.7841 Z0.0373
X3.6517 Y0.7852 Z0.045
Z0.6

M9
M5
G28 G91 Z0.
G90
G28 G91 X0. Y0.
G90
M30

 

Thanks, Mark 

Message 8 of 9
aju_augustine
in reply to: reeltime273

Hi @reeltime273,

 

I'm not certain if there's an option to add Trailing Zeroes. Perhaps @seth.madore  could shed some light on this.

 

However, you can certainly modify the post to match your desired format using the codes provided below:

 

 

  writeComment("PROGRAM NAME AND OPERATION: " + programName);
  writeComment("MACHINE MANUFACTURER: " + "BRIDGEPORT SERIES 1")  // ADDED 04.09.2024 BY MB
  writeComment("CNC PROGRAM: " + "CNC_DC BY JIM DAWSON")  // ADDED 04.09.2024 BY MB
  writeComment("CADCAM SOFTWARE: FUSION 360")  // ADDED 04.09.2024 BY MB 
  writeComment("POST PROCESSOR: GENERIC MACH 3 MILL BY ARTSOFT")  // ADDED 04.09.2024 BY MB 
  writeComment("PROGRAMMED BY: MARK BATES")  // ADDED 04.09.2024 BY MB 
  writeComment(localize("POST GENERATED ON") + " " + now.toLocaleDateString() + " " + now.toLocaleTimeString());  // ADDED 04.09.2024 BY MB 
  var workpiece = getWorkpiece();
  var delta = Vector.diff(workpiece.upper, workpiece.lower);
  writeComment(" Stock dimension X = " + (delta.x).toFixed(2) + " ");
  writeComment(" Stock dimension Y = " + (delta.y).toFixed(2) + " ");
  writeComment(" Stock dimension Z = " + (delta.z).toFixed(2) + " ");
  var partX = toPreciseUnit((getGlobalParameter("part-upper-x") - getGlobalParameter("part-lower-x")), MM);
  var partY = toPreciseUnit((getGlobalParameter("part-upper-y") - getGlobalParameter("part-lower-y")), MM);
  var partZ = toPreciseUnit((getGlobalParameter("part-upper-z") - getGlobalParameter("part-lower-z")), MM);
  writeComment(" Part dimension X = " + partX.toFixed(2) + " ");
  writeComment(" Part dimension Y = " + partY.toFixed(2) + " ");
  writeComment(" Part dimension Z = " + partZ.toFixed(2) + " ");
  writeComment(" Stock Lower in WCS X= " + toPreciseUnit(getGlobalParameter("stock-lower-x"), MM).toFixed(2) + " ");
  writeComment(" Stock Lower in WCS Y= " + toPreciseUnit(getGlobalParameter("stock-lower-y"), MM).toFixed(2) + " ");
  writeComment(" Stock Lower in WCS Z= " + toPreciseUnit(getGlobalParameter("stock-lower-z"), MM).toFixed(2) + " ");
  writeComment(" Stock Upper in WCS X= " + toPreciseUnit(getGlobalParameter("stock-upper-x"), MM).toFixed(2) + " ");
  writeComment(" Stock Upper in WCS Y= " + toPreciseUnit(getGlobalParameter("stock-upper-y"), MM).toFixed(2) + " ");
  writeComment(" Stock Upper in WCS Z= " + toPreciseUnit(getGlobalParameter("stock-upper-z"), MM).toFixed(2) + " ");

 

 

I hope you find this useful!

 

_1.png

 



Aju Augustine
Technology Consultant
Message 9 of 9
reeltime273
in reply to: aju_augustine

I can live with that final revision, thanks for your help!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report