######################################################################
#
# Macro Name    : c:/users/public/geovia/surpac/67_60/demo_data/tutorials2/solids/jw4.tcl
#
# Version       : Surpac 6.7 Beta 1
#
# Creation Date : Fri Mar 07 09:09:54 2014
#
# Description   : 
#
######################################################################

set status [ SclFunction "EXIT GRAPHICS" {} ]

set status [ SclFunction "PLAN" {} ]

set status [ SclFunction "RECALL ANY FILE" {
  file="lev200.str"
  mode="openInNewLayer"
}]

set status [ SclFunction "DRAW STRINGS" {
  frm00089={
    {
      _action="display"      
      range1=""
      range2=""
      range3=""
      ifld_num="d1"
      textalignment="<"
      position="First point"
      layer_name="lev200.str"
    }
  }
}]

set status [ SclFunction "FILE SAVE" {
  frmsaveFileAs={
    {
      _action="display"
      output_file="back1"
      output_type="Surpac String Files"
      outputExt=".str"
      Surpac={
        Purpose=""
        range="2;30003"
        FileFormat="text"
        ForceValidation="true"
        ForceCompatibility="true"
      }
      saveStyle="N"
    }
  }
  frm00121={
    {
      _action=""
    }
  }
}]

set status [ SclFunction "FILE SAVE" {
  frmsaveFileAs={
    {
      _action="display"
      output_file="floor1"
      output_type="Surpac String Files"
      outputExt=".str"
      Surpac={
        Purpose=""
        range="1;1001"
        FileFormat="text"
        ForceValidation="true"
        ForceCompatibility="true"
      }
      saveStyle="N"
    }
  }
  frm00121={
    {
      _action=""
    }
  }
}]

set status [ SclFunction "EXIT GRAPHICS" {} ]

set status [ SclFunction "RECALL ANY FILE" {
  file="back1.str"
  mode="openInNewLayer"
}]

set status [ SclFunction "IDENTIFY SEGMENT" {
  select_point=table { winx winy objectx objecty objectz snap_projection } {
    { "0.052" "0.003" "14281.590" "11659.999" "743.231" "off" }
    { "-0.042" "0.058" "14269.394" "11664.127" "741.228" "off" }
  }
}]

set status [ SclFunction "GRAPHICS CREATE DTM" {
  frm01311={
    {
      _action="display"
      object_num="1"
      obj_name=""
      plane="plan"
      breaktest="Y"
      interpolate_new_points="N"
    }
  }
}]

set status [ SclFunction "GRAPHICALLY CLIP DTM" {
  select_triangle=table { winx winy objectx objecty objectz } {
    { "0.080" "-0.076" "14285.156" "11654.182" "742.538" }
    { "0.043" "-0.124" "14280.465" "11650.617" "742.499" }
    { "-0.003" "-0.018" "14274.460" "11658.498" "742.191" }
  }
  select_point={
    {
      _action="cancel"
    }
    {
      _action="cancel"
    }
    {
      winx="0.032"
      winy="-0.098"
      objectx="14278.964"
      objecty="11652.493"
      objectz="742.461"
      snap_projection="off"
    }
  }
  frm01324={
    {
      _action="display"      
      inout="INSIDE"
      new_bdy_layer=""
    }
  }
}]

set status [ SclFunction "FILE SAVE" {
  frmsaveFileAs={
    {
      _action="display"      
      output_file="back1"
      output_type="Surpac DTM Files"
      outputExt=".dtm"
      Surpac={
        Purpose=""
        range=""
        FileFormat="text"
        ForceValidation="true"
        ForceCompatibility="true"
      }
      saveStyle="N"
    }
  }
  frmSaveMultipleFiles={
    {
      _action="apply"
    }
  }
}]

set status [ SclFunction "EXIT GRAPHICS" {} ]

set status [ SclFunction "RECALL ANY FILE" {
  file="floor1.str"
  mode="openInNewLayer"
}]

set status [ SclFunction "GRAPHICS CREATE DTM" {
  frm01311={
    {
      _action="display"
      object_num="1"
      obj_name=""
      plane="plan"
      breaktest="Y"
      interpolate_new_points="N"
    }
  }
}]

set status [ SclFunction "GRAPHICALLY CLIP DTM" {
  select_triangle={
    {
      winx="-0.177"
      winy="0.086"
      objectx="14251.865"
      objecty="11665.878"
      objectz="732.354"
    }
  }
  select_point={
    {
      winx="-0.201"
      winy="0.058"
      objectx="14248.674"
      objecty="11663.813"
      objectz="731.892"
      snap_projection="off"
    }
  }
  frm01324={
    {
      _action="display"
      inout="INSIDE"
      new_bdy_layer=""
    }
  }
}]

set status [ SclFunction "FILE SAVE" {
  frmsaveFileAs={
    {
      _action="display"
      output_file="floor1"
      output_type="Surpac DTM Files"
      outputExt=".dtm"
      Surpac={
        Purpose=""
        range=""
        FileFormat="text"
        ForceValidation="true"
        ForceCompatibility="true"
      }
      saveStyle="N"
    }
  }
  frmSaveMultipleFiles={
    {
      _action="apply"
    }
  }
}]

set status [ SclFunction "EXIT GRAPHICS" {} ]

set status [ SclFunction "NEW LAYER" {
  frm00488={
    {
      swa_name="tmp"
    }
  }
}]

set status [ SclFunction "RECALL ANY FILE" {
  file="floor1.dtm"
  mode="appendToCurrentLayer"
}]

set status [ SclFunction "RECALL ANY FILE" {
  file="back1.dtm"
  mode="appendToCurrentLayer"
}]


set status [ SclFunction "ERASE DTM/3DM" {
  frm00089={
    {
      range1="1"
      range2="1"
      range3=""
      textalignment="<"
      layer_name="tmp"
    }
  }
}]

set status [ SclFunction "TRISOLATION RENUMBER" {
  select_triangle={
    {
      winx="-0.216"
      winy="0.124"
      objectx="14246.804"
      objecty="11668.225"
      objectz="731.980"
    }
  }
  frm00453={
    {
      newobj="1"
      newtrisol="1"
    }
  }
}]

set status [ SclFunction "DRAW OBJECTS" {
  frm00089={
    {
      range1="1"
      range2="1,2"
      range3=""
      ifld_num="d1"
      textalignment="<"
      layer_name="tmp"
    }
  }
}]

set status [ SclFunction "FILE SAVE" {
  frmsaveFileAs={
    {
      _action="display"
      output_file="drives1"
      output_type="Surpac DTM Files"
      outputExt=".dtm"
      Surpac={
        Purpose=""
        range=""
        FileFormat="text"
        ForceValidation="true"
        ForceCompatibility="true"
      }
      saveStyle="N"
    }
  }
  frmSaveMultipleFiles={
    {
      _action="apply"
    }
  }
}]

set status [ SclFunction "EXIT GRAPHICS" {} ]

set status [ SclFunction "RECALL ANY FILE" {
  file="drives1.dtm"
  mode="openInNewLayer"
}]

set status [ SclFunction "DRAW STRINGS" {
  frm00089={
    {
      _action="display"
      range1="1,2"
      range2=""
      range3=""
      ifld_num="d1"
      textalignment="<"
      position="First point"
      layer_name="drives1.dtm"
    }
  }
}]


set status [ SclFunction "TRIANGULATE MANY SEGMENTS" {
  frm00459={
    {
      iobj="1"
      itrisol="1"
    }
  }
  frm00651={
    {
      theopt1="N"
      theopt2="R"
    }
  }
  frm00655={
    {
      str_seg="STR"
      seg_no="1"
      str_rg="1,2"
    }
  }
}]

set status [ SclFunction "TRIANGULATE MANY SEGMENTS" {
  frm00459={
    {
      iobj="1"
      itrisol="1"
    }
  }
  frm00651={
    {
      theopt1="N"
      theopt2="R"
    }
  }
  frm00655={
    {
      str_seg="STR"
      seg_no="2"
      str_rg="1,2"
    }
  }
}]

set status [ SclFunction "FILE SAVE" {
  frmsaveFileAs={
    {
      _action="display"
      output_file="drives1"
      output_type="Surpac DTM Files"
      outputExt=".dtm"
      Surpac={
        Purpose=""
        range=""
        FileFormat="text"
        ForceValidation="true"
        ForceCompatibility="true"
      }
      saveStyle="N"
    }
  }
  frmSaveMultipleFiles={
    {
      _action="apply"
    }
  }
}]

set status [ SclFunction "NEIGHBOURS AND VALIDATE OBJECT" {
  frmvalidateObject={
    {
      _action="display"
      report_file="valid"
      obj_range=""
      trisol_range=""
      fix_problems="N"
      set_as_solid="Y"
      colours=table { colour_label colour_field } {
        { "Holes" "GREEN" }
        { "Intersecting triangles" "CYAN" }
        { "Invalid edges only" "ORANGE" }
        { "Open edges" "MAGENTA" }
        { "Reversed triangles" "RED" }
      }
    }
  }
  frm00121={
    {
      _action=""
    }
  }
}]

set status [ SclFunction "OBJECT REPORT" {
  frm00466={
    {
      _action="display"
      reploc="drives"
      repid="1"
      report_format=".not"
      checkoverlaps="N"
      report_type="T"
      decimals="0"
    }
  }
  frm00121={
    {
      _action=""
    }
  }
}]

puts ""
puts ""
puts "Macro _15_create_underground_model.tcl successfully completed."
puts ""