#-----------------------------------------------------------
proc onsmartLoopsDEZLoad {} {

    if {$min_edge == ""} {set min_edge 5}
    if {$min_area == ""} {set min_area 100}
    if {$max_curv == ""} {set max_curv 80}
    if {$max_ang == ""} {set max_ang 60}

}

#-------------------------------------------------
proc onsmartLoopsDEZAfterLoad {} {
    if $auto_pick_mode {smartloopSurfPick pick}
}

proc onsmartLoopsDEZOK {}  {
    if {$surfs == ""} return

    set exclusion_surfs ""
    set loops [b scrib_lib_feature_find_smart_loop_surfs $surfs [expr $min_edge * 2]  \
	$min_edge $min_edge $min_area 1 $max_ang $max_curv $exclusion_surfs ]
    mess "loops are $loops\n"
    set i 1
    foreach loop $loops {
	aie_create_mesh_subset LOOPS/LOOP$i [list surface $loop]
	mess "creating loop LOOP$i\n"
	incr i
    }

    if $auto_pick_mode {smartloopSurfPick pick}
}


#-------------------------------------Auto pick procedure for SmartLoops ----------------------------------
proc onsmartloopSurfPickLoad {} {
    if $auto_pick_mode {smartloopSurfPick pick}
}
#-----
#------------------------------------Start of Auto Apply procedures in SmartLoops --------------------------
proc onsmartloopSurfPickFinish {} {
    if {($surfs != "") && $auto_pick_mode } {
	smartLoopsDEZ apply
	ic_mess "$surfs"
	smartloopSurfPick pick
    }
}



