3D HST Default Formula Files
Mastercam default formula files apply only to 3D high speed toolpaths. The formulas are for calculating the default values for 3D high speed toolpaths and are stored in files with .formula extensions. Typically, these are stored in the following folder:
..\Shared Mastercam 2023\mill\FORMULA
Mastercam installs a default .formula file that contains the system defaults. If you wish, you can select a different set of defaults. Typically, different default files are created for different materials. For example, for softer materials you might use more aggressive cutting parameters.
-
Click Select default formula on the toolbar.
-
Select the desired file.
- Mastercam displays the active .formula file in the Quick View Settings window.
Even though the file extension is .formula, these are XML files. Use any XML editor to open and edit them. You can also use Microsoft® Notepad, a text editor, or HTML editor to work on them.
Depending on the XML editor you use, it might be easier to open and edit the files if you first change the extension to .xml before editing the file, and changing it back to .formula after you are done.
The best practice for creating a new .formula file is to start with an existing file—typically, default.formula—and use your editor’s Save As command to create the new file. This ensures that the new file has the proper XML tag structure, and that it has a complete set of default values for all toolpath types and pages. Remember, Mastercam default formula files apply only to 3D high speed toolpaths.
Make sure that the <?xml…> and <HST_Formula_Data…> tags in your new files exactly match the ones shown here:
If you have made changes to the default .formula file and want to start over with the original Mastercam-supplied defaults, follow these steps.
- Delete the default.formula file.
- Restart Mastercam.
- Create a high speed toolpath.
Mastercam automatically regenerates a default .formula file from its system defaults.
- Even if you have never used XML files, the .formula files are easy
to understand. They consist of a series of nested objects that correspond
to the parameter pages in your HST dialog box.
- Each toolpath type is represented by a <toolpath> object.
- Each toolpath contains a collection of parameter pages. Each parameter page is represented by a <page> object. Most toolpaths contain Cut parameters, Linking, and Transition pages.
- Each page contains <group> objects. Each group contains a set of parameters.
- Each field on each page is represented by a <param> object.
- Each object has a name and a target. When you need to refer to a field in a formula, you refer to its target.
- Each <param> object has a value. This represents the default value for that field. To change the default value for a field, you need to locate the <param> object for the field and change this value. Sometimes this value is just a single number. That means the default value is a constant that does not depend on the tool or any other parameter. Notice that the value is not enclosed by < > brackets.
- Sometimes the value is an expression or formula. It is enclosed within ( ) parentheses. Notice it contains the target for another field, STEPDOWN.
The default value for each field can be either of two types:
Constant: This means that the default value will not change with a new tool and is not linked to any other parameter.
This example sets the default Stock to leave amount at 0.05:
<param name="Stock to leave" target="STOCK_TO_LEAVE">0.05</param>
Formula: This means that the default value is dynamically calculated based on the selected tool or another parameter.
This example sets the default Stepdown to 10% of the tool diameter:
<param name="Stepdown" target="STEPDOWN">(@DIAMETER * 0.10)</param>
Formulas can be any conventional mathematical expression. Follow these rules:
- The entire formula must be enclosed within ( ) parentheses. You can nest parentheses to create more complicated expressions.
- To refer to another field, use its target with an @ symbol.
- Use standard mathematical operators: +/– *^
- The following standard math and trig functions are available: sqrt( ), tan( ), sin( ), cos( ), atan( ), acos( ), asin( ).
- Use degrees for angles, not radians. Pre-defined constants #RadToDeg and #DegToRad let you convert between the two.
- Other named constants are #Pi and #E.
If any default values use constants, you will need to create separate files for inch and metric values.





