Changing NC Files Using Global Arithmetic

www.kxcad.net Home > CAM Index > EdgeCAM Index >


Your Ad Here

Use the Global Arithmetic (Edit menu) command to make changes to the file using macros. These macros can be created from new or pre-defined.

When you select this command, a dialog appears with a blank window. You can now either type in a macro or load a pre-defined .mlc macro file.

Here is an example of a simple macro:

global arithmetic dialog

The macro can change the values of any words identified for the control associated with the file (‘default’ if no control specified).

An example macro is xyz.mlc, shown here:

global arithmetic dialog with example macro

If you check the Confirm Changes box, when you run the macro you will be asked to confirm each change the macro makes.

Click on the Run button to activate the macro. When the macro reaches a position in the file where a change is required, this dialog is displayed:

running global macro dialog

Confirm – Click on this button to accept this change and continue the macro.

Ignore – Do not make this change but continue running the macro.

Finish – Stops the macro, accepting any changes made so far.

Cancel – Stops the macro and resets any changes made.

 

Here is a simple command used in a Global Arithmetic macro:

#WORDw

This macro command allows you to specify a variable, generally using a single letter word ID w, such as N for the sequence word or X, Y, Z for co-ordinates and so on.

The Editor changes any line when either the buffer has been modified or a word on the line has changed. Any word values that are modified are automatically formatted according to the control setup.

Example

#WORDX=#WORDX*2

This sets the new value of the word ‘X’ to ‘2 times the previous value of the word X’.

The expressions used in Global Arithmetic include addition, subtraction, multiplication and division.

Your Ad Here