# Script file for the scripting library (scrib)
#
# File: scrib/scripts/assembly.tcl
#
# $Revision$ on $Date$
# 
# Copyright (c) 1993-2003 ICEM CFD Engineering
#
#--------------------------------------------------------------------


if {![info exists proc_scrib_data(dir)] || ("" == $proc_scrib_data(dir))} {
    set proc_scrib_data(dir) [pwd]
}
if ![info exists proc_scrib_data(export_dir)] {
    set proc_scrib_data(export_dir) "."
} elseif ![file isdirectory $proc_scrib_data(export_dir)] {
    file mkdir $proc_scrib_data(export_dir)
}
set assembly_mesh [file join $proc_scrib_data(export_dir) [file root $proc_scrib_data(export_file)].uns]
set assembly_tin [file root $assembly_mesh].tin
set assembly_fbc [file root $assembly_mesh].fbc
#
#-------------------------------------------------------
#
# --> merge the mesh files into a mesh assembly assembly_mesh
#
scrib_lib_uns_load_files $proc_scrib_data(cadsys) $proc_scrib_data(cad_dir) \
    $proc_scrib_data(export_dir) "_offset.uns" $assembly_mesh
#
# --> merge the tetin files into a geometry assembly_tin
#
scrib_lib_geo_import_mesh $assembly_mesh $assembly_tin
#
# --> merge up the family boco file into assembly_fbc
#
scrib_lib_assembly_familybocos_load $proc_scrib_data(export_dir) $assembly_fbc
#
# --> write out a report
#
ic_reports_write_mesh_report All [file root $assembly_mesh].html -format html -mesher "Batch Surface"
