Вы находитесь на странице: 1из 5

Drillhole Stope Proximity Check

Modified on: Wed, 25 Sep, 2019 at 8:24 PM

KBID: DMS000391

Datamine Scripts and Macros are provided as-is and are not formally supported by Datamine.
The information and data on this page is provided for you as a starting point to extend your
customization knowledge.

Macro Description

Compatible Products: Studio EM, Studio RM, Studio OP, Studio UG, Studio Survey

Proximity check to find and report drillholes which come within X meters of a planned stope.

Data

Example data is provided for this macro - the attached archive contains the referenced files.

Macro Listing

!START BEGIN
#August 2019 Datamine Corporate Limited
#Description in following prompt

!PROMPT
0 This macro is designed to check for drillholes in proximity to a selected
0 wireframe. It will generate a csv report and a filtered drillhole file,
0 containing the drillholes which may intercept the stope.
0 ---------------------------------------------------------------------------
--
0 Please note that all input files should be located inside your project
file.
0 ---------------------------------------------------------------------------
--
0 Enter your drillhole file.
1 Drillhole input : [_vb_holes] > '$dhole#',a,28
0
0 Enter your stope wireframe name (leave off the tr and pt suffix).
1 Wireframe input : [FakeStope] > '$stope#',a28
0
0 What proximity would you like to be flagged?
1 Danger zone : [10] > '$search#',n
0
0 How fine of a resolution would you like?
1 Resolution : [1] metres > '$resolution#',n

#Fill wireframe with blocks


!wirefill &WIRETR($stope#tr),&WIREPT($stope#pt),
&MODEL(xx_bm),@ZCODE=1.0,@WIRETYPE=1.0,
@CELLXMIN={$resolution# / 4},@CELLXMAX=$resolution#,
@CELLYMIN={$resolution# / 4},@CELLYMAX=$resolution#,
@CELLZMIN={$resolution# / 4},@CELLZMAX=$resolution#

#Flagging for estimation


!EXTRA &IN(xx_bm),&OUT(xx_bm2),@APPROX=0.0
FLAGZ = 1
erase(XMORIG,YMORIG,ZMORIG,NX,NY,NZ,IJK)
GO

#Composite drillhole for sensitivity


!SELCOP &IN($dhole#),&OUT(xx_dh),*F1(BHID),*F2(X),
*F3(Y),*F4(Z),*F5(LENGTH),*F6(A0),*F7(B0),*F8(FROM),*F9(TO),
@KEEPALL=0.0

!COMPDH &IN(xx_dh),&OUT(xx_dh2),*BHID(BHID),*FROM(FROM),
*TO(TO),@INTERVAL=1.0,@MAXGAP=0.0,
@MINCOMP=0.5,@START=0.0,@MODE=0.0

#Make another BM for the drillhole estimation.


!stats &in(xx_dh2),&out(xx_stats),
*f1(X),*f2(Y),*f3(Z)

!field $exists#=xx_stats, $recnum#=1,


$xmin#=MINIMUM,$xmax#=MAXIMUM
!field $exists#=xx_stats, $recnum#=2,
$ymin#=MINIMUM,$ymax#=MAXIMUM

!field $exists#=xx_stats, $recnum#=3,


$zmin#=MINIMUM,$zmax#=MAXIMUM

!let $xmin# = {int($xmin#) - ($resolution# * 2)}


!let $xmax# = {int($xmax#) + ($resolution# * 2)}
!let $xinc# = $resolution#
!let $nx# = {($xmax#-$xmin#)/$resolution#}

!let $ymin# = {int($ymin#) - ($resolution# * 2)}


!let $ymax# = {int($ymax#) + ($resolution# * 2)}
!let $yinc# = $resolution#
!let $ny# = {($ymax#-$ymin#)/$resolution#}

!let $zmin# = {int($zmin#) - ($resolution# * 2)}


!let $zmax# = {int($zmax#) + ($resolution# * 2)}
!let $zinc# = $resolution#
!let $nz# = {($zmax#-$zmin#)/$resolution#}

!protom &out(xx_fitprot2),@rotmod=0
n
n
$xmin#
$ymin#
$zmin#
$xinc#
$yinc#
$zinc#
$nx#
$ny#
$nz#

!IJKGEN &PROTO(xx_fitprot2),&IN(xx_dh2),&OUT(xx_dhbm),*X(X),*Y(Y),
*Z(Z),@PSMODEL=1.0

#Generating estimation parameter file


!inputd &out(xx_estparsv)
Search parameter file for ESTIMA
SREFNUM n y 0
SMETHOD n y 0
SDIST1 n y 0
SDIST2 n y 0
SDIST3 n y 0
SANGLE1 n y 0
SANGLE2 n y 0
SANGLE3 n y 0
SAXIS1 n y 3
SAXIS2 n y 1
SAXIS3 n y 3
MINNUM1 n y 10
MAXNUM1 n y 32
SVOLFAC2 n y 0
MINNUM2 n y 10
MAXNUM2 n y 32
SVOLFAC3 n y 0
MINNUM3 n y 10
MAXNUM3 n y 32
OCTMETH n y 0
MINOCT n y 0
MINPEROC n y 0
MAXPEROC n y 0
MAXKEY n y 0
SANGL1_F a 8 y ''
SANGL2_F a 8 y ''
SANGL3_F a 8 y ''
]
ok

!indata &in(xx_estparsv),&out(xx_estparsv)

1,2,$search#,$search#,$search#,0,0,0,3,1,3,1,2

#Generating search parameter file


!inputdd &out(xx_estparep)
Estimation parameter file for ESTIMA using OK
VALUE_IN a 8 y ''
VALUE_OU a 8 y ''
IMETHOD n y 3
SREFNUM n y 0
SVOL_F a 8 y ''
]
ok
!indata &in(xx_estparep),&out(xx_estparep)

FLAGZ,FLAGZ,1,1,DANGER

#Convert drillhole into a block model


!EXTRA &IN(xx_dhbm),&OUT(xx_dhbm2),@APPROX=0.0
XA = X
YA = Y
ZA = Z
BHIDA;a24 = BHID
FROMA = FROM
TOA = TO
LENGTHA = LENGTH
A0A = A0
B0A = B0
C0A = C0
RADIUSA = RADIUS
erase(X,Y,Z,BHID,FROM,TO,LENGTH,A0,B0,C0,RADIUS)
GO

#Estimating nearest neighbour


!ESTIMA &PROTO(xx_dhbm2),&IN(xx_bm2),&SRCPARM(xx_estparsv),
&ESTPARM(xx_estparep),&MODEL(xx_Output),*X(XC),*Y(YC),*Z(ZC),
@DISCMETH=1.0,@XPOINTS=1.0,@YPOINTS=1.0,@ZPOINTS=1.0,
@XDSPACE=1.0,@YDSPACE=1.0,@ZDSPACE=1.0,@PARENT=1.0,
@MINDISC=1.0,@COPYVAL=0.0,@FVALTYPE=1.0,@FSTEP=1.0,
@XSUBCELL=1.0,@YSUBCELL=1.0,
@ZSUBCELL=1.0,@LINKMODE=3.0,@UCSAMODE=2.0,@UCSBMODE=3.0,
@UCSCMODE=2.0,@UCSALIMT=0.0,@PLANE=1.0,@TOLRNC=0.0,
@ORGTAG=-,@GRMETHOD=3.0,@PGFIELDS=0.0,@ORDER=3.0,
@DYANKR=1.0

##Convert drillhole 'block model' back to a drillhole


!EXTRA &IN(xx_Output),&OUT(xx_Output2),@APPROX=0.0
X = XA
Y = YA
Z = ZA
BHID;a20 = BHIDA
FROM = FROMA
TO = TOA
LENGTH = LENGTHA
A0 = A0A
B0 = B0A
C0 = C0A
RADIUS = RADIUSA
erase(XA,YA,ZA,BHIDA,FROMA,TOA,LENGTHA,A0A,B0A,C0A,RADIUSA,FLAGZ)
erase(XMORIG,YMORIG,ZMORIG,NX,NY,NZ,IJK,XINC,YINC,ZINC,XC,YC,ZC)
GO

###Generation of a csv 'Report' file


!MGSORT &IN(xx_output2),&OUT(xx_output1),*KEY1(BHID),*KEY2(FROM),*KEY3(FROM
)

!COMPDH &IN(xx_output1),&OUT(xx_output3),*BHID(BHID),*FROM(FROM),
*TO(TO),*ZONE(DANGER),@INTERVAL=9999.0,@MAXGAP=0.0,
@MINCOMP=1.0,@START=0.0,@MODE=0.0
!PICREC &IN(xx_output3),&OUT(xx_output4),@APPEND=0.0
DANGER = 1 END

!EXTRA &IN(xx_output4),&OUT(xx_output5),@APPROX=0.0
WARNING;a20 = "Proximity to stope"
GO

!OUTPUT &IN(xx_output5),*F1(BHID),*F2(FROM),*F3(TO),*F4(WARNING),
@CSV=1.0,@NODD=0.0,@DPLACE=-1.0,@IMPLICIT=0.0
report.csv

###Generation of a drillhole file with just the danger holes


!SELCOP &IN(xx_output3),&OUT(xx_filter),*F1(BHID),*F2(DANGER),
@KEEPALL=0.0

!EXTRA &IN(xx_filter),&OUT(xx_filter2),@APPROX=0.0
IF (DANGER !=1) delete()
END
GO

!RESTRI &IN1(xx_output3),&IN2(xx_filter2),&OUT(Danger_Holes),
*KEY1(BHID)

#Cleanup
!LISTDR xx?,&OUT(xx)
!DELETE &IN(xx),@CONFIRM=0.0

!ECHO -----------------------------------------------------------------------
--
!ECHO Finished generating a report file and a filtered drillhole file
!ECHO containing holes which come within $search# metres of $stope#
!ECHO These are named 'report.csv' and 'Danger_Holes'

!END

More information
You can find out more about the processes/commands involved in this customization example using your online Help. Your
Studio Application contains a context-sensitive help file (click the 'stack of books' icon in the top-right corner plus a dedicated
Help file for scripters ("Scripting COM Reference").