proc t_rampant_write_input {} {
    global file_name t_rampant_output_path icem_fluent icem_powermesh 
    global confname 
    global file_name
    
    set domain [domain_select $file_name(domains_dir) "Select an unstructured domains." unstruct 0]
    if {$domain == {}} return

    get_boco_topo
    set family_boco $file_name(mesh_dir)/family_boco
    
    if {$icem_fluent} {
	    set outfile t_rampant
    } else {
	set outfile $file_name(transfer_dir)/t_rampant
    }

    set trionly 0

    set params {}
    lappend params {trionly -opt {{Yes 1} {No 0}} \
		-title "Write only triangles"}
    lappend params {bocofile -type path -title "Boco file"}
    lappend params {outfile -type path -title "Output file"}

    if {![dialog .rampant "Rampant" \
          "Please edit the following Rampant options." $params]} return

    # strip extension in case user specified it
    if {[file extension $outfile] == ".msh"} {
	set outfile [file rootname $outfile]
    }

    if {[file exists $outfile.msh] && \
        [query_question .query "Overwrite $outfile.msh?"] != "*okay*"} return

    set triflag ""; if $trionly { set triflag " -only_triangles" }

    
    set command "\"$t_rampant_output_path\" \"$domain\" \"$bocofile\" \"$outfile\" \"$triflag\""
    
    runcom $command ""
}
