WriteCommand
This method is used to write G/M code commands inside NC program output. This method only gets one parameter of string type. Therefore, you must write the expression in quotation marks.
Example: WriteCommand (“M08”) This will write M08 in the NC program.
Note: You can also use this method instead of WriteComment by adding the necessary punctuations on your own.
Example (Fanuc,Mazatrol,Mitsubishi): You should add the parentheses. WriteCommand(“(ToolChange)”) is same with WriteComment(“ToolChange”)
Example (Heidenhain,Siemens): You should add semicolon(;). WriteCommand(“;ToolChange”) is same with WriteComment(“ToolChange”)