Templates
CNC Macro Simulator II supports templates! What are templates? Templates are the game changer in the CNC industry! They allow code reuse, make the program smaller and more readable, but at the same time they are not a compatibility issue as they will be converted to pure g-code* on the fly. Moreover, they allow you to use arguments that allow you to pass a given value to template. Remember that you can nest templates as many times as you want!
So how to use them? It's so easy, just take a look:
Write or open the program in the editor
Save as template (the @ symbol will be added automatically)
To use it, add "@" before the template name (for example, the template name was a circle, followed by an @circle)
To edit it, just select your template in "Open template", edit it and save it by selecting “save”.
Inside of your template code:
then call your template:
Isn't that amazing? By using words that you understand, the arguments become self-explanatory which will make it easier for you and the person working with your programs.
*If the program contains a macro, it should be converted to pure g-code using the "export" option.