/*
@Node Header
@Next Macro

Code:       opt2d.rexx
Author:     Russell Leighton
Revision:   16 Feb 1994

Comments:

Invoke  node order optimizer on current model.  This script prompts for the
starting  element  which  is  used by the optimizer as the root to the tree
search.  Selection of this root element can greatly influence the resulting
optimization.  No model file is saved or overwritten.

@EndNode
@Node Macro
*/

options results

address ami2d

'save(t:temp.dat)'
result = Request(,,"Select starting element",,"OKAY","CANCEL","AMI2D")
if result = '' then exit
'info(elem)'
parse var result nd id junk
if id < 1 then id = 1
'clear'
'save(ram:temp.dat)'
address command 'ami2d:bin/opt2d ram:temp.dat -n'nd
'read(ram:temp.dat)'
'plot'
address command 'delete ram:temp.dat'
exit
