######################################################################
#
# Macro Name    : c:/tutorials/drill_and_blast/data/06_presplit_holes.tcl
#
# Version       : Surpac Vision V5.2-C
#
# Creation Date : Tue Jun 27 11:36:57 2006
#
# Description   : 
#
######################################################################

file delete -force pattern940-2.str

set status [ SclFunction "EXIT GRAPHICS" {
  frm00108={
    {
      exit_mode="E"
    }
  }
}]

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

SclPause 2

set status [ SclFunction "WINDOW IN" {
  window_drag={
    {
      winx1="0.292"
      winy1="-0.521"
      winx2="0.440"
      winy2="-0.862"
      objectx1="311.452"
      objecty1="660.566"
      objectz1="950.000"
      objectx2="354.903"
      objecty2="587.527"
      objectz2="950.000"
    }
  }
}]

set status [ SclFunction "BLAST PRESPLIT SEG" {
  world_drag={
    {
      objectx="308.374"
      objecty="722.578"
      objectz="950.000"
      dx="299.413"
      dy="610.729"
      dz="950.000"
      drag_direction="0"
    }
  }
  frm01128={
    {
      _action=display
      size_method="Spacing"
      spacing_inp="5"
      offset="0"
      collar_el="Selected Segment"
      hole_length="Set to Segment"
      segment_offset="0"
      segment_fix="Bearing"
      diameter="0.076"
      clip="No"
      pattern_id="940-2ps"
      prefix="940-"
      suffix="ps"
      start="101"
      pad_check="No"
      subdrill=""
      rig="Rig-1"
    }
  }
  select_point={
    {
      winx="-0.049"
      winy="0.732"
      objectx="306.385"
      objecty="715.413"
      objectz="940.554"
    }
  }
}]

set status [ SclFunction "DRAW DESC" {
  frm00089={
    {
      range1=""
      range2=""
      range3=""
      ifld_num="d3"
      textalignment="<"
      position="All points"
      legend_location="no legend"
      layer_name="blast hole layer"
    }
  }
}]

########### pause here, wait for user response (say enter key), then proceed
puts ""
puts ""
puts ""
puts ""
puts "Click in graphics to continue."
puts ""
puts ""

set form {
  GuidoForm form_1 {
    -default_buttons
    -label "Presplit holes along segment"
    GuidoPanel panel_1 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_1 {
      -label ""
      -height 6
      -width 50
        GuidoTextArea text_1 {
        -format none
        -linewrap true
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
Pre-split holes have been created from the crest of the 950 bench to the toe of the road.

Next the hole lengths will be displayed.

"
        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}

set status [ SclFunction "ERASE DESC" {
  frm00089={
    {
      range1=""
      range2=""
      range3=""
      textalignment="<"
      legend_location="no legend"
      layer_name="blast hole layer"
    }
  }
}]

set status [ SclFunction "VIEW BY BEARING" {
  frm00289={
    {
      bearing="130"
      dip="-20"
    }
  }
}]

set status [ SclFunction "IDENTIFY POINT" {
  select_point={
    {
      winx="-0.417"
      winy="-0.202"
      objectx="309.055"
      objecty="718.029"
      objectz="948.011"
    }
  }
}]

set form {
  GuidoForm form_1 {
    -default_buttons
    -label "Blast Work Order Report"
    GuidoPanel panel_1 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_1 {
      -label ""
      -height 6
      -width 50
        GuidoTextArea text_1 {
        -format none
        -linewrap true
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
The description field data is displayed in the message window below.

d1 = DrillBlast1.1 d2 = HoleID d3 = Hole Number d4 = Hole Length d5 = Diameter

The hole length in the d4 field will be displayed next.
"
        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}

set status [ SclFunction "DRAW DESC" {
  frm00089={
    {
      range1=""
      range2=""
      range3=""
      ifld_num="d4"
      textalignment="<"
      position="All points"
      legend_location="no legend"
      layer_name="blast hole layer"
    }
  }
}]

########### pause here, wait for user response (say enter key), then proceed
puts ""
puts ""
puts ""
puts ""
puts "Click in graphics to continue."
puts ""
puts ""

SclPause

set status [ SclFunction "PLAN" {} ]


set form {
  GuidoForm form_1 {
    -default_buttons
    -label "Blast Work Order Report"
    GuidoPanel panel_1 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_1 {
      -label ""
      -height 6
      -width 50
        GuidoTextArea text_1 {
        -format none
        -linewrap true
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
Next we will manually delete all holes less than 1.5 meters in length.

"
        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}

set status [ SclFunction "BLAST DELETE HOLE" {
  select_point=table { winx winy objectx objecty objectz } {
    { "-0.102" "-0.614" "301.101" "614.570" "950.000" }
    { "-0.083" "-0.552" "303.003" "619.221" "950.000" }
    { "-0.031" "0.828" "308.287" "722.601" "950.000" }
  }
}]

set status [ SclFunction "SAVE FILE AS" {
  output_file="pattern940-2.str"
  output_type="Surpac String Files"
  output_filenames=""
  Surpac={
    Purpose=""
    range=""
    FileFormat="text"
    ForceValidation="true"
    ForceCompatibility="true"
  }
}]


########### stop here, end of macro
puts ""
puts ""
puts ""
puts ""
puts "End of Macro 06a_presplit_holes_segment.tcl"
puts ""
puts ""
