Automatic command files

 

Add extra commands and batch operations to program operation

 

It can be useful to automate common jobs, for example:-

 

- reserve stock after an optimisation

- optimise after importing parts

- remember to copy summary data to another file

- always make a backup at the end of the day

- provide extra reminders after some operations

 

The automatic command options allow the specification of a command, batch file, or script file which can run automatically when exiting from program activities (e.g. on leaving Review runs).

 

 Select: Tools - Automatic command files

 

mct1821-01.png

 

 Enter the path to the batch or script file or the command, next to the required program activity.

 

Use the list button to select paths and files.

 

The other options are:-

 

Ok - Save changes and exit

Help - further information on this dialog

Print - print list of commands

Cancel - abandon changes and exit

 

For example, a typical business process for Stock control is as follows:-

 

- Optimise a part list

- Check the results in Review runs

- Decide whether the run is Ok

- Exit Review runs

- Go to Stock control

- Reserve stock for the run

 

It is easy to forget to make a reservation. The Automatic command feature can be used to help automate the stock reservation process and reduce the effort needed to run it.

 

To do this create a batch or script file which can be run on Exit from Review runs. Here is an example:-

 

MyAllocate.vbs

 

'***************

askuser

'

Sub askuser

Dim ans

Dim wshShell

'

set wshShell = WScript.CreateObject("WSCript.shell")

ans = MsgBox("Reserve boards", vbYesNo, "Reserve")

If ans = vbYes Then

wshShell.CurrentDirectory ="c:\V12\demo\user1\"

wshShell.run "c:\V12\stock.exe /allocstock"

Else

'

End If

End Sub

'***************

 

To run in the correct place the batch program is scheduled to run on the exit of Review runs. Once Review runs is exited the following dialog would be shown:-

 

mct1821-02.png

 

 

 

Notes

 

- Stand alone options - several portions of the Optimising program can be run 'stand alone', that is, run separately from running the optimising program in the usual way. These options may be needed for some command operations, for example, stock /allocstock to reserve stock; refer to the Stand alone help topics for full details.

 

- If any stand alone commands are to be run directly from the Auxiliary menu, Automatic command files, Saw transfer (program name) or Machining transfer (post transfer program) areas of the software then any equals sign "=" should be replaced with a colon ":".

 

See also