Share

Adding comments to macros

It is good practise to put comments into a macro file to explain what it does. A comment is a line of text which has no effect on the running of the macro file but may help anyone examining the file to understand it. Comment lines start with //. For example:

// This macro imports my standard model, creates a block,
// and a ball nosed tool.

It is also good practise to have comments explaining what each section of the macro file does. This may be obvious when you write the macro but later it may be difficult to understand. It is good practise to put the comments which describe commands before the actual commands:

// Clean all the Roughing boundaries
MACRO Clean 'boundary\Roughing'

Another use of comments is to temporarily remove a command from a macro. When debugging or writing a macro, it is a good idea to write one step at a time and re-run the macro after each change. If your macro contains a lengthy calculation, or the recreation of toolpaths, you may want to temporarily comment out the earlier parts of the macro whilst checking the later parts. For example:

// Import the model
// IMPORT TEMPLATE ENTITY TOOLPATH "Finishing/Raster-Flat-Finishing.ptf"

Was this information helpful?