Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Tool list post


Recommended Posts

Here you go.

[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V21.00 P4 E1 W21.00 T1505932414 M21.00 I0 O10
# ToolList.mcpost

#region Settings

#region User Settings

# Max length of stool_name, used for formatting
name_length     : 24

# Max length of sassembly_name, used for formatting
assembly_length : 14

#endregion

#region Post Settings

x_tooltable$ : 1
newglobal$   : 1
rotaxtyp$    : 99999

#endregion

#endregion

#region initializations

#region Enumerators

ZERO@            : 0
ONE@
TWO@

TOOL_INFO_TABLE@ : 1
OP_PARAMETERS@   : 0

TOOL_NOT_OUTPUT@ : 1

#endregion

#region Numerics

result          : 0
op_number       : 0

#region Globals

diameter      = tlrad$
corner_radius = tcr$

#endregion

#endregion

#region Strings

stool_name     : ""
sholder_name   : ""
sassembly_name : ""
sspaces        : "                                                  "
sregex         : ""

#endregion

#endregion

#region Formats

#region Statments

fs2 1   0.8 0.8
fs2 2   0.4 0.3
fs2 3   1 0 1 0

#endregion

#region Assignments

fmt  ""       3  op_number       ""
fmt  "     "  3  tt_tool$        "       "
fmt  ""       3  name_length     ""
fmt  ""       3  assembly_length ""

fmt  ""       2  diameter        "   "
fmt  ""       2  corner_radius   "              "

#endregion

#endregion

#region Lookup Tables

fprmtbl 1 4   # TOOL_INFO_TABLE@
        15240 op_number
        20001 stool_name
        20020 sholder_name
        20021 sassembly_name

#endregion

pset_string_length
    sregex = ".{" + drs_str(TWO@, name_length) + "}"
    stool_name = stool_name + sspaces
    stool_name = regex(sregex, stool_name)

    sregex = ".{" + drs_str(TWO@, assembly_length) + "}"
    sassembly_name = sassembly_name + sspaces
    sassembly_name = regex(sregex, sassembly_name)

ptooltable$
    if tt_count$ = TOOL_NOT_OUTPUT@,
      [
      result = fprm(TOOL_INFO_TABLE@, OP_PARAMETERS@)
      pset_string_length
      *tt_tool$, stool_name, *diameter, [if corner_radius > ZERO@, *corner_radius, else, "                   "], sassembly_name, sholder_name, e$
      *e$
      ]

pheader$
    "Tool Number   Tool Name               Diameter   Corner Radius     Assembly       Holder", e$
    *e$
    x_tooltable$

 

  • Like 4
Link to comment
Share on other sites
9 hours ago, SlaveCam said:

Is there a readily available post processor that writes a tool list similar to the one that right click->tool list over operations tree does?

What you are looking for is called a "Dot SET" File. (.SET) That is the File Extension, and they were usually found in the "shared mcam_\mill\posts" folder.

This is a Setup Sheet and/or Tool List, that is output by MP.DLL, using the <setup sheet name>.SET file. It is just a Post Processor at it's heart, so you can do all of the normal String and Numeric Variable manipulation that you would normally do in a PST file, except that the output is just an ASCII text file. (No pictures, unless you know how to do real C++ programming, and want to launch a DLL from within the PST file, but that is complicated and much too big in scope to describe here.)

I believe you'll find "Mill.SET" and "Mill2.SET".

Link to comment
Share on other sites
15 minutes ago, jeff.D said:

Here you go.


[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V21.00 P4 E1 W21.00 T1505932414 M21.00 I0 O10
# ToolList.mcpost

#region Settings

#region User Settings

# Max length of stool_name, used for formatting
name_length     : 24

# Max length of sassembly_name, used for formatting
assembly_length : 14

#endregion

#region Post Settings

x_tooltable$ : 1
newglobal$   : 1
rotaxtyp$    : 99999

#endregion

#endregion

#region initializations

#region Enumerators

ZERO@            : 0
ONE@
TWO@

TOOL_INFO_TABLE@ : 1
OP_PARAMETERS@   : 0

TOOL_NOT_OUTPUT@ : 1

#endregion

#region Numerics

result          : 0
op_number       : 0

#region Globals

diameter      = tlrad$
corner_radius = tcr$

#endregion

#endregion

#region Strings

stool_name     : ""
sholder_name   : ""
sassembly_name : ""
sspaces        : "                                                  "
sregex         : ""

#endregion

#endregion

#region Formats

#region Statments

fs2 1   0.8 0.8
fs2 2   0.4 0.3
fs2 3   1 0 1 0

#endregion

#region Assignments

fmt  ""       3  op_number       ""
fmt  "     "  3  tt_tool$        "       "
fmt  ""       3  name_length     ""
fmt  ""       3  assembly_length ""

fmt  ""       2  diameter        "   "
fmt  ""       2  corner_radius   "              "

#endregion

#endregion

#region Lookup Tables

fprmtbl 1 4   # TOOL_INFO_TABLE@
        15240 op_number
        20001 stool_name
        20020 sholder_name
        20021 sassembly_name

#endregion

pset_string_length
    sregex = ".{" + drs_str(TWO@, name_length) + "}"
    stool_name = stool_name + sspaces
    stool_name = regex(sregex, stool_name)

    sregex = ".{" + drs_str(TWO@, assembly_length) + "}"
    sassembly_name = sassembly_name + sspaces
    sassembly_name = regex(sregex, sassembly_name)

ptooltable$
    if tt_count$ = TOOL_NOT_OUTPUT@,
      [
      result = fprm(TOOL_INFO_TABLE@, OP_PARAMETERS@)
      pset_string_length
      *tt_tool$, stool_name, *diameter, [if corner_radius > ZERO@, *corner_radius, else, "                   "], sassembly_name, sholder_name, e$
      *e$
      ]

pheader$
    "Tool Number   Tool Name               Diameter   Corner Radius     Assembly       Holder", e$
    *e$
    x_tooltable$

 

That's no fair Jeff, you're making it too easy on them!

I really need to get into the new Tool Table stuff, and it looks like this is a good excuse to do that. Thanks for the sample, I'm sure it will be helpful to everyone who likes to play with Posts.

  • Like 1
  • Haha 1
Link to comment
Share on other sites
19 hours ago, Colin Gilchrist said:

That's no fair Jeff, you're making it too easy on them!

I really need to get into the new Tool Table stuff, and it looks like this is a good excuse to do that. Thanks for the sample, I'm sure it will be helpful to everyone who likes to play with Posts.

Yeah, normally I wouldn't post the exact solution, but there aren't many enhanced tool-table examples in the wild. 

 

19 hours ago, Colin Gilchrist said:

Can you enlighten me on what the 'regex' function does?

Jlw hit the nail on the head, it's used for string manipulation.  It's much more powerful than MP's 'legacy' string functions.

 

14 minutes ago, SlaveCam said:

Now whoever told you that?! Why disable it in the first place since the user is already being warned when you press the button.

That key combination is not a something that should be used in most circumstances.  

That keystroke combination is from V9 when there was no machine and control definition.  With the MD/CD/Post setup it can be dangerous to swap a post in on the fly, especially if the post reads data from the MD/CD.

 

Link to comment
Share on other sites
14 minutes ago, jeff.D said:

it can be dangerous to swap a post in on the fly

True, and there is a warning when you do it. It is however a good way to test post edits without setting up a whole new machine.

Renaming the .SET file as a .PST file and launching here was the only way I could get a tool list  to launch on its own. Changing the CD setting only changed the set up sheet output. The right click ops menu Toolist still gave me the Active Reports viewer.

Link to comment
Share on other sites
21 hours ago, jeff.D said:

Here you go.


[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V21.00 P4 E1 W21.00 T1505932414 M21.00 I0 O10
# ToolList.mcpost

#region Settings

#region User Settings

# Max length of stool_name, used for formatting
name_length     : 24

# Max length of sassembly_name, used for formatting
assembly_length : 14

#endregion

#region Post Settings

x_tooltable$ : 1
newglobal$   : 1
rotaxtyp$    : 99999

#endregion

#endregion

#region initializations

#region Enumerators

ZERO@            : 0
ONE@
TWO@

TOOL_INFO_TABLE@ : 1
OP_PARAMETERS@   : 0

TOOL_NOT_OUTPUT@ : 1

#endregion

#region Numerics

result          : 0
op_number       : 0

#region Globals

diameter      = tlrad$
corner_radius = tcr$

#endregion

#endregion

#region Strings

stool_name     : ""
sholder_name   : ""
sassembly_name : ""
sspaces        : "                                                  "
sregex         : ""

#endregion

#endregion

#region Formats

#region Statments

fs2 1   0.8 0.8
fs2 2   0.4 0.3
fs2 3   1 0 1 0

#endregion

#region Assignments

fmt  ""       3  op_number       ""
fmt  "     "  3  tt_tool$        "       "
fmt  ""       3  name_length     ""
fmt  ""       3  assembly_length ""

fmt  ""       2  diameter        "   "
fmt  ""       2  corner_radius   "              "

#endregion

#endregion

#region Lookup Tables

fprmtbl 1 4   # TOOL_INFO_TABLE@
        15240 op_number
        20001 stool_name
        20020 sholder_name
        20021 sassembly_name

#endregion

pset_string_length
    sregex = ".{" + drs_str(TWO@, name_length) + "}"
    stool_name = stool_name + sspaces
    stool_name = regex(sregex, stool_name)

    sregex = ".{" + drs_str(TWO@, assembly_length) + "}"
    sassembly_name = sassembly_name + sspaces
    sassembly_name = regex(sregex, sassembly_name)

ptooltable$
    if tt_count$ = TOOL_NOT_OUTPUT@,
      [
      result = fprm(TOOL_INFO_TABLE@, OP_PARAMETERS@)
      pset_string_length
      *tt_tool$, stool_name, *diameter, [if corner_radius > ZERO@, *corner_radius, else, "                   "], sassembly_name, sholder_name, e$
      *e$
      ]

pheader$
    "Tool Number   Tool Name               Diameter   Corner Radius     Assembly       Holder", e$
    *e$
    x_tooltable$

 

Time for a sanity check. I tested this this morning and thought it works, now after some modifications I get tool dia and radius same for every tool. I reverted back to the original code above and still the same.

Btw. is there a shortcut to "expand all regions" in Code Expert?

Link to comment
Share on other sites

Yep, that was my bad.  Below will resolve the issue.  I only tested it with one tool and assumed that the system variables were updated each time ptooltable$ was called. 

[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V21.00 P4 E1 W21.00 T1505932414 M21.00 I0 O10
# ToolList.mcpost

#region Settings

#region User Settings

# Max length of stool_name, used for formatting
name_length     : 24

# Max length of sassembly_name, used for formatting
assembly_length : 14

#endregion

#region Post Settings

x_tooltable$ : 1
newglobal$   : 1
rotaxtyp$    : 99999

#endregion

#endregion

#region initializations

#region Enumerators

ZERO@            : 0
ONE@
TWO@
THREE@

TOOL_INFO_TABLE@ : 1
OP_PARAMETERS@   : 0

TOOL_NOT_OUTPUT@ : 1

#endregion

#region Numerics

result          : 0
op_number       : 0
diameter        : 0
corner_radius   : 0

#endregion

#region Strings

s1013          : ""
stool_name     : ""
sholder_name   : ""
sassembly_name : ""
sspaces        : "                                                  "
sregex         : ""

#endregion

#endregion

#region Formats

#region Statments

fs2 1   0.8 0.8
fs2 2   0.4 0.3
fs2 3   1 0 1 0

#endregion

#region Assignments

fmt  ""       3  op_number       ""
fmt  "     "  3  tt_tool$        "       "
fmt  ""       3  name_length     ""
fmt  ""       3  assembly_length ""

fmt  ""       2  diameter        "      "
fmt  ""       2  corner_radius   "            "

#endregion

#endregion

#region Lookup Tables

fprmtbl 1 5   # TOOL_INFO_TABLE@
        1013  s1013
        15240 op_number
        20001 stool_name
        20020 sholder_name
        20021 sassembly_name

#endregion

pset_string_length
    sregex = ".{" + drs_str(TWO@, name_length) + "}"
    stool_name = stool_name + sspaces
    stool_name = regex(sregex, stool_name)

    sregex = ".{" + drs_str(TWO@, assembly_length) + "}"
    sassembly_name = sassembly_name + sspaces
    sassembly_name = regex(sregex, sassembly_name)

pget_tool_size
    diameter = rparsngl(s1013, TWO@)
    corner_radius = rparsngl(s1013, THREE@)

ptooltable$
    if tt_count$ = TOOL_NOT_OUTPUT@,
      [
      result = fprm(TOOL_INFO_TABLE@, OP_PARAMETERS@)
      pset_string_length
      pget_tool_size
      *tt_tool$, stool_name, *diameter, [if corner_radius > ZERO@, *corner_radius, else, "                "], sassembly_name, sholder_name, e$
      *e$
      ]

pheader$
    "Tool Number   Tool Name               Diameter   Corner Radius     Assembly       Holder", e$
    *e$
    x_tooltable$

Ctrl+M will expand all regions.

Link to comment
Share on other sites
1 hour ago, jeff.D said:

Yep, that was my bad.  Below will resolve the issue.  I only tested it with one tool and assumed that the system variables were updated each time ptooltable$ was called. 


[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V21.00 P4 E1 W21.00 T1505932414 M21.00 I0 O10
# ToolList.mcpost

#region Settings

#region User Settings

# Max length of stool_name, used for formatting
name_length     : 24

# Max length of sassembly_name, used for formatting
assembly_length : 14

#endregion

#region Post Settings

x_tooltable$ : 1
newglobal$   : 1
rotaxtyp$    : 99999

#endregion

#endregion

#region initializations

#region Enumerators

ZERO@            : 0
ONE@
TWO@
THREE@

TOOL_INFO_TABLE@ : 1
OP_PARAMETERS@   : 0

TOOL_NOT_OUTPUT@ : 1

#endregion

#region Numerics

result          : 0
op_number       : 0
diameter        : 0
corner_radius   : 0

#endregion

#region Strings

s1013          : ""
stool_name     : ""
sholder_name   : ""
sassembly_name : ""
sspaces        : "                                                  "
sregex         : ""

#endregion

#endregion

#region Formats

#region Statments

fs2 1   0.8 0.8
fs2 2   0.4 0.3
fs2 3   1 0 1 0

#endregion

#region Assignments

fmt  ""       3  op_number       ""
fmt  "     "  3  tt_tool$        "       "
fmt  ""       3  name_length     ""
fmt  ""       3  assembly_length ""

fmt  ""       2  diameter        "      "
fmt  ""       2  corner_radius   "            "

#endregion

#endregion

#region Lookup Tables

fprmtbl 1 5   # TOOL_INFO_TABLE@
        1013  s1013
        15240 op_number
        20001 stool_name
        20020 sholder_name
        20021 sassembly_name

#endregion

pset_string_length
    sregex = ".{" + drs_str(TWO@, name_length) + "}"
    stool_name = stool_name + sspaces
    stool_name = regex(sregex, stool_name)

    sregex = ".{" + drs_str(TWO@, assembly_length) + "}"
    sassembly_name = sassembly_name + sspaces
    sassembly_name = regex(sregex, sassembly_name)

pget_tool_size
    diameter = rparsngl(s1013, TWO@)
    corner_radius = rparsngl(s1013, THREE@)

ptooltable$
    if tt_count$ = TOOL_NOT_OUTPUT@,
      [
      result = fprm(TOOL_INFO_TABLE@, OP_PARAMETERS@)
      pset_string_length
      pget_tool_size
      *tt_tool$, stool_name, *diameter, [if corner_radius > ZERO@, *corner_radius, else, "                "], sassembly_name, sholder_name, e$
      *e$
      ]

pheader$
    "Tool Number   Tool Name               Diameter   Corner Radius     Assembly       Holder", e$
    *e$
    x_tooltable$

Ctrl+M will expand all regions.

Jeff, for different tools our customers like different types of output. Can you break down the new method for pulling things from the tools?

On Taps I like to see the Pitch

On Drills I like to see the Tip Angle

On Slotting Tool I like to see the thickness of the Slotting Tool, If it has an upper and lower Radius that is different I would like to have the upper and lower radius also output.

On Chamfer Mills the angle of the Chamfer Mill

On Spot Drill the angle of the Spot Drill

On Thread Mills the Shank Dia., Tool Diameter, Pitch and Number of teeth.

I am sure I will think of some more, but having these as part of a tooltable would help with a lot of our customers.

 

Can you help me understand what the @ sign after each of the variables and numbers does when the post reads them? I have a general understanding of everything else, but just not understanding the impact of the @ sign for outputting and how it helps the post to do the work with that variable or number.

Thank you for posting up and sharing this valuable information I appreciate it.

 

 

Link to comment
Share on other sites
8 hours ago, 5th Axis CGI said:

Jeff, for different tools our customers like different types of output. Can you break down the new method for pulling things from the tools?

On Taps I like to see the Pitch

On Drills I like to see the Tip Angle

On Slotting Tool I like to see the thickness of the Slotting Tool, If it has an upper and lower Radius that is different I would like to have the upper and lower radius also output.

On Chamfer Mills the angle of the Chamfer Mill

On Spot Drill the angle of the Spot Drill

On Thread Mills the Shank Dia., Tool Diameter, Pitch and Number of teeth.

I am sure I will think of some more, but having these as part of a tooltable would help with a lot of our customers.

 

Can you help me understand what the @ sign after each of the variables and numbers does when the post reads them? I have a general understanding of everything else, but just not understanding the impact of the @ sign for outputting and how it helps the post to do the work with that variable or number.

Thank you for posting up and sharing this valuable information I appreciate it.

 

 

 

The '@' on the end of a variable name makes it an enumerator.  Enumerators are light weight variables that don't have previous or extended values.

 

And here is a sample of what you asked about...

[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V21.00 P4 E1 W21.00 T1505932414 M21.00 I0 O10
# ToolExample.mcpost

#region Settings

#region Post Settings

x_tooltable$ : 1
newglobal$   : 1
rotaxtyp$    : 99999

#endregion

#endregion

#region Initializations

#region Enumerators

ZERO@            : 0
ONE@
TWO@
THREE@


CUSTOM@          : 0
CENTER_DRILL@
SPOT_DRILL@
DRILL@
RIGHT_HAND_TAP@
LEFT_HAND_TAP@
REAMER@
BORING_BAR@
COUNTERBORE@
COUNTERSINK@
END_MILL@
BALL_MILL@
CHAMFER_MILL@
FACE_MILL@
SLOT_MILL@
RADIUS_MILL@
DOVE_MILL@
TAPER_MILL@
LOLLIPOP_MILL@
BULL_MILL@
BLOCK_DRILL@
ENGRAVE_TOOL@
BRADPOINT_DRILL@
HIGH_FEED_MILL@
THREAD_MILL@
BARREL_FORM@
TAPER_FORM@
LENS_FORM@

TOOL_NOT_OUTPUT@ : 1

#endregion

#region Numerics

result          : 0
slot_thickness  : 0

#region Arrays

#NCI 20004
tool_number    : 0
tool_type      : 0
tool_material  : 0
corner_type    : 0
tool_diameter  : 0
corner_radius  : 0
pitch          : 0
tip_angle      : 0
dia_offset     : 0
length_offset  : 0
linear_feed    : 0
plunge_feed    : 0
retract_feed   : 0
spindle_speed  : 0
coolant_type   : 0 # Obsolete
number_flutes  : 0
shank_diameter : 0
taper_length   : 0
chamfer_length : 0
drill_length   : 0
drill_diameter : 0
secondary_rad  : 0
second_c_len   : 0
second_c_ang   : 0
shank_type     : 0
neck_diameter  : 0
thread_form    : 0

#NCI 20007
pilot_diameter      : 0
flute_length        : 0
overall_length      : 0
Shoulder length     : 0
arbor_diameter      : 0
holder_diameter     : 0
holder_length       : 0
spindle_direction   : 0
percent_surface     : 0
percent_feed        : 0
units               : 0
tool_projection     : 0
Total_holder_length : 0

#endregion

#endregion

#region Strings

s20004         : ""
s20007         : ""
stool_name     : ""
sunits         : ""

#endregion

#endregion

#region Formats

#region Statments

fs2 1   0.8 0.8
fs2 2   0.4 0.3
fs2 3   1 0 1 0

#endregion

#region Assignments

fmt  ""       3  op_number       ""
fmt  "T"      3  tool_number     " -"
fmt  ""       3  name_length     ""
fmt  ""       3  assembly_length ""

fmt  "Diameter    : " 2  tool_diameter   sunits
fmt  "Tip Angle   : " 2  tip_angle       " deg."
fmt  "Pitch       : " 2  pitch           sunits
fmt  "Corner Rad. : " 2  corner_radius   sunits
fmt  "Upper Rad.  : " 2  secondary_rad   sunits
fmt  "Thickness   : " 2  slot_thickness  sunits


#endregion

#endregion


pget_tool_info
    s20004 = opinfo(20004, ZERO@)
    tool_number = rpar(s20004, 27)
	s20007 = opinfo(20007, ZERO@)
	pilot_diameter = rpar(s20007, 13)

ptooltable$
    if tt_count$ = TOOL_NOT_OUTPUT@,
      [
      pget_tool_info
	  if tool_type = CENTER_DRILL@ |
         tool_type = DRILL@,
         [
         *tool_number, "DRILL", e$
         "    ", *tool_diameter, e$ 
         "    ", *tip_angle, e$ 
         ]
		 
	  if tool_type = RIGHT_HAND_TAP@ |
	     tool_type = LEFT_HAND_TAP@,
	     [
		 *tool_number, "TAP", e$
		 "    ", *tool_diameter, e$
		 if not(met_tool$), pitch = ONE@ / pitch
		 "    ", *pitch, e$ 
		 ]
		 
	  if tool_type = SLOT_MILL@,
	     [
		 *tool_number, "SLOT MILL", e$
		 "    ", *tool_diameter, e$
		 slot_thickness = flute_length
		 "    ", *slot_thickness, e$
		 "    ", *secondary_rad, e$ 
		 "    ", *corner_radius, e$ 
         ]	     
      *e$
      ]

pheader$
    if met_tool$, sunits = "mm"
    else, sunits = "in"
    x_tooltable$

 

 

Link to comment
Share on other sites
15 hours ago, jeff.D said:

 

The '@' on the end of a variable name makes it an enumerator.  Enumerators are light weight variables that don't have previous or extended values.

 

And here is a sample of what you asked about...


[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V21.00 P4 E1 W21.00 T1505932414 M21.00 I0 O10
# ToolExample.mcpost

#region Settings

#region Post Settings

x_tooltable$ : 1
newglobal$   : 1
rotaxtyp$    : 99999

#endregion

#endregion

#region Initializations

#region Enumerators

ZERO@            : 0
ONE@
TWO@
THREE@


CUSTOM@          : 0
CENTER_DRILL@
SPOT_DRILL@
DRILL@
RIGHT_HAND_TAP@
LEFT_HAND_TAP@
REAMER@
BORING_BAR@
COUNTERBORE@
COUNTERSINK@
END_MILL@
BALL_MILL@
CHAMFER_MILL@
FACE_MILL@
SLOT_MILL@
RADIUS_MILL@
DOVE_MILL@
TAPER_MILL@
LOLLIPOP_MILL@
BULL_MILL@
BLOCK_DRILL@
ENGRAVE_TOOL@
BRADPOINT_DRILL@
HIGH_FEED_MILL@
THREAD_MILL@
BARREL_FORM@
TAPER_FORM@
LENS_FORM@

TOOL_NOT_OUTPUT@ : 1

#endregion

#region Numerics

result          : 0
slot_thickness  : 0

#region Arrays

#NCI 20004
tool_number    : 0
tool_type      : 0
tool_material  : 0
corner_type    : 0
tool_diameter  : 0
corner_radius  : 0
pitch          : 0
tip_angle      : 0
dia_offset     : 0
length_offset  : 0
linear_feed    : 0
plunge_feed    : 0
retract_feed   : 0
spindle_speed  : 0
coolant_type   : 0 # Obsolete
number_flutes  : 0
shank_diameter : 0
taper_length   : 0
chamfer_length : 0
drill_length   : 0
drill_diameter : 0
secondary_rad  : 0
second_c_len   : 0
second_c_ang   : 0
shank_type     : 0
neck_diameter  : 0
thread_form    : 0

#NCI 20007
pilot_diameter      : 0
flute_length        : 0
overall_length      : 0
Shoulder length     : 0
arbor_diameter      : 0
holder_diameter     : 0
holder_length       : 0
spindle_direction   : 0
percent_surface     : 0
percent_feed        : 0
units               : 0
tool_projection     : 0
Total_holder_length : 0

#endregion

#endregion

#region Strings

s20004         : ""
s20007         : ""
stool_name     : ""
sunits         : ""

#endregion

#endregion

#region Formats

#region Statments

fs2 1   0.8 0.8
fs2 2   0.4 0.3
fs2 3   1 0 1 0

#endregion

#region Assignments

fmt  ""       3  op_number       ""
fmt  "T"      3  tool_number     " -"
fmt  ""       3  name_length     ""
fmt  ""       3  assembly_length ""

fmt  "Diameter    : " 2  tool_diameter   sunits
fmt  "Tip Angle   : " 2  tip_angle       " deg."
fmt  "Pitch       : " 2  pitch           sunits
fmt  "Corner Rad. : " 2  corner_radius   sunits
fmt  "Upper Rad.  : " 2  secondary_rad   sunits
fmt  "Thickness   : " 2  slot_thickness  sunits


#endregion

#endregion


pget_tool_info
    s20004 = opinfo(20004, ZERO@)
    tool_number = rpar(s20004, 27)
	s20007 = opinfo(20007, ZERO@)
	pilot_diameter = rpar(s20007, 13)

ptooltable$
    if tt_count$ = TOOL_NOT_OUTPUT@,
      [
      pget_tool_info
	  if tool_type = CENTER_DRILL@ |
         tool_type = DRILL@,
         [
         *tool_number, "DRILL", e$
         "    ", *tool_diameter, e$ 
         "    ", *tip_angle, e$ 
         ]
		 
	  if tool_type = RIGHT_HAND_TAP@ |
	     tool_type = LEFT_HAND_TAP@,
	     [
		 *tool_number, "TAP", e$
		 "    ", *tool_diameter, e$
		 if not(met_tool$), pitch = ONE@ / pitch
		 "    ", *pitch, e$ 
		 ]
		 
	  if tool_type = SLOT_MILL@,
	     [
		 *tool_number, "SLOT MILL", e$
		 "    ", *tool_diameter, e$
		 slot_thickness = flute_length
		 "    ", *slot_thickness, e$
		 "    ", *secondary_rad, e$ 
		 "    ", *corner_radius, e$ 
         ]	     
      *e$
      ]

pheader$
    if met_tool$, sunits = "mm"
    else, sunits = "in"
    x_tooltable$

 

 

That is totally different than the old way of going about this. Thank you and have to put a bug in 3rd Party Post people to look into this moving into 2020.

Link to comment
Share on other sites
1 hour ago, jlw™ said:

Jeff, enumerator here the same thing as C#?

The concept is the same yes.  It's a list of named constant integer values.

In MP, every numeric variable has four possible values; current, extended, previous, and previous extended. 

An enumerator on the other hand only  has one value, and that's the value it was initialized too.  This makes it much lighter weight, and I personally think it  makes the code more readable.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...