# ICEM CFD solver interface routine for the manager.
#
# Copyright (c) 1993-1995 ICEM Systems.

proc iples_write_input {} {
    global confname file_name iples_output_path icem_powermesh
    global file_name

    get_boco_topo

    set outfile $file_name(transfer_dir)/geom.inp
    set domainfile $file_name(domains_dir)/hex.uns
    
    if {![dialog .iples "iPLES" \
          "Please edit the following iPLES options." {
	{bocofile -type path -title "Boco file" -help "Boundary condition file"}
        {domainfile -type path -title "Domain file" -help "Domain file"}
	{outfile -type path -title "Output file" -help "Output file"}
    }]} return

    if {![file exists $domainfile]} {
	errormsg "Domain file doesn't exist!"
	return
    }	

    if {![file exists $bocofile]} {
	errormsg "Boundary condition file doesn't exist!"
	return
    }
    
    set command "\"$iples_output_path\" -b \"$bocofile\" -d \"$domainfile\" -o \"$outfile\""
    
    runcom $command ""
}
