######################################################################
#
# Macro Name    : c:/gemcom/surpac/surpacv6.1/tutorials/block_modelling/data_work/_07_partial_percentages.tcl
#
# Version       : Surpac 6.1 Beta 6
#
# Creation Date : Tue Aug 26 10:28:14 2008
#
# Description   : 
#
######################################################################

set status [ SclFunction "EXIT GRAPHICS" {} ]

set status [ SclFunction "BM EXIT" {
  frm20103={
    {
      exit_mode="S"
    }
  }
}]


if { [catch {
set status [ SclFunction "BLOCK MODEL OPEN" {
  frm00906={
    {
      modname="training2.mdl"
      use_const="N"
    }
  }
}]
}]}  {
puts "There is no training2.mdl. This could occur if you haven't yet run previous block modelling macros. Opening training.mdl instead."
set status [ SclFunction "BLOCK MODEL OPEN" {
  frm00906={
    {
      modname="training.mdl"
      use_const="N"
    }
  }
}]
}

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

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

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

set status [ SclFunction "FILE SAVE" {
  frmsaveFileAs={
    {
      _action=display
      AutoCAD={
        version="Autocad 18"
      }
      output_file="surpac2dtm:orebody1"
      outputExt=".dtm"
      saveStyle="N"
      Datamine={
        binary_precision="Single"
      }
      Surpac={
        FileFormat="text"
        ForceValidation="true"
        Purpose="DTM for partial percentages"
        ForceCompatibility="true"
        range=""
      }
      output_type="Surpac DTM Files"
    }
  }
  frmSaveMultipleFiles={
    {
      _action="display"
    }
  }
}]

set status [ SclFunction "TOOL MODE TRADITIONAL" {} ]

set status [ SclFunction "TOOL MODE TRADITIONAL" {} ]

set status [ SclFunction "BM ADD ATTRIBUTE" {
  frm20150={
    {
      _action=display
      attributes={
        {
          name="partial_p"
          type="float"
          decimals="3"
          bgv="0"
          description="partial percentage values"
        }
      }
    }
  }
}]

set status [ SclFunction "CHECK BM CONNECTED" {} ]

set status [ SclFunction "PARTIAL PERCENTAGES" {
  constraint_type="3DM"
  attribute="partial_p"
  precision="3"
  save="Y"
  save_file_name="orebody1.bpp"
  file="orebody"
  id="1"
  inside="Y"
  object_range=""
  trisol_range=""
  frm00121={
    {
      _action="display"
    }
  }
}]

set status [ SclFunction "BM VOL TON REPORT" {
  frm20104={
    {
      _action=display
      fname=""
      report_name="bmrpt_without_partial_p"
      report_format=".not - Surpac Note File"
      ik_cutoffs="No"
      ikMeanGrade="cutoffMean"
      constrain="Yes"
    }
  }
  frm20195={
    {
      _action=display
      rpt_desc_1="Orebody report from training block model without using partial percentage attribute"
      report_attributes={
        {
          rpt_attribute="gold"
          rpt_display="Yes"
          low_cut=null
          upper_cut=null
          rpt_attribute_wt="Mass"
          rpt_attribute_avg="Average"
          rpt_expression=null
        }
      }
      use_vol="No"
      Format_head="Yes"
      fillAllCells="No"
      cullEmpty="No"
      volDecimals="2 decimal places"
      geometryType="None"
      vol_mult_factor="Attribute"
      mult_factor_att_name="sg"
      group_attributes={
        {
          group_field="gold"
          numeric_range="0;3;9;999"
        }
      }
    }
  }
  frm20111={
    {
      _action=display
      constraints=table { not op contype location id rnga rngb lbound ubound ext } {
        { "" "INSIDE" "3DM" "OREBODY" "1" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
      }
      conexp=""
      confile=""
      keep_blocks="N"
    }
  }
}]

set status [ SclFunction "RECALL ANY FILE" {
  file="bmrpt_without_partial_p.not"
  mode="none"
}]

set status [ SclFunction "BM VOL TON REPORT" {
  frm20104={
    {
      _action=display
      fname=""
      report_name="bmrpt_with_partial_p"
      report_format=".not - Surpac Note File"
      report_type="Standard"      
      ik_cutoffs="No"
      ikMeanGrade="cutoffMean"
      constrain="Yes"
    }
  }
  frm00121={
    {
      _action="display"
    }
  }
  frm20195={
    {
      _action=display
      rpt_desc_1="Orebody report from training.mdl using a partial percentage attribute"
      report_attributes={
        {
          rpt_attribute="gold"
          rpt_display="Yes"
          low_cut=null
          upper_cut=null
          rpt_attribute_wt="Mass"
          rpt_attribute_avg="Average"
          rpt_expression=null
        }
      }
      use_vol="Yes"
      vol_att="partial_p"
      Format_head="Yes"
      fillAllCells="No"
      pivotCompatible="No"
      cullEmpty="No"
      volDecimals="2 decimal places"
      geometryType="None"
      vol_mult_factor="Attribute"
      mult_factor_att_name="sg"
      group_attributes={
        {
          group_field="gold"
          numeric_range="0;3;9;999"
        }
      }
    }
  }
  frm20111={
    {
      _action=display
      constraints=table { not op contype location id rnga rngb lbound ubound ext } {
        { "" "INSIDE" "3DM" "OREBODY" "1" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
        { "" "" "" "" "" "" "" "" "" "" }
      }
      conexp=""
      confile=""
      keep_blocks="Y"
    }
  }
}]

set status [ SclFunction "RECALL ANY FILE" {
  file="bmrpt_with_partial_p.not"
  mode="none"
}]

set status [ SclFunction "BM SAVE MODEL" {
  frm00121={
    {
      _action="display"
    }
  }
}]

set status [ SclFunction "BM EXIT" {} ]

puts ""
puts ""
puts "macro _08b_partial_percentages.tcl completed"
puts ""


