Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

1/1/22, 10:22 AM Code Drillholes with Wireframes (Macro) : DATAMINE SOFTWARE

Code Drillholes with Wireframes (Macro)


Modified on: Wed, 23 Sep, 2020 at 5:29 PM

KBID: DMS000004

Content in this section is provided as-is and is not supported by Datamine. 

Automation scripts and macros may not be compatible with your product & version.

Macro Description

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

This macro injects attributes into a specified drillholes file based on wireframes. Drillholes are enhanced with ZONECODE
information associated with one or more wireframe files as defined in an external .csv file.

For this example, the external CSV file contains the following fields: TYPE (A8), WIREFRAM (A24), ZONECODE (N),
PRIORITY (N), TOPCUT (N) and GROUP (N), although this example can be easily modified to suit any file structure/layout.
For example:

WF,_vb_min,1,2,3,4

STR,_vb_str1,,,,

WF,_vb_min2,2,2,3,4

Note that the wireframe specification in the CSV file does not include either the 'tr' or 'pt' suffix.

The macro creates a DM file copy of the CSV file using INPFIL, then pics out any record with a TYPE of "WF". It then sets
up some substitution variables using FIELD before calling SELTRI to determine which sample records sit inside/outside the
wireframe volume and adding the ZONECODE field and corresponding waste (99) or zone code to the output samples file.

Inputs and outputs are defined at the top of the file e.g.:

!LET $IN# = _vb_holes

!LET $OUT# = DH_CODED

https://datamine.freshdesk.com/en/support/solutions/articles/19000088118-code-drillholes-with-wireframes-macro- 1/6
1/1/22, 10:22 AM Code Drillholes with Wireframes (Macro) : DATAMINE SOFTWARE

Set up the required fields in the macro to match those of the CSV file (in this case "MODPAR.csv" to be consumed, e.g.:

!INPFIL &OUT(XXCONT)

MODEL CONTROL FILE

TYPE A 8 Y ''

WIREFRAM A 24 Y ''

ZONECODE N Y -

PRIORITY N Y -

TOPCUT N Y -

GROUP N Y -

MODPAR.csv

The macro does the rest. Drillhole records lying outside the wireframe will be coded with ZONECODE=99, otherwise, the
relevant ZONECODE will be applied to the output samples file.

Macro Listing

https://datamine.freshdesk.com/en/support/solutions/articles/19000088118-code-drillholes-with-wireframes-macro- 2/6
1/1/22, 10:22 AM Code Drillholes with Wireframes (Macro) : DATAMINE SOFTWARE

!START CODE

# _____________________________________________________________________________

# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

# DATAMINE SOFTWARE

# Description: Code drillholes with Wireframes

# requires MODPAR.csv

# This macro is not supported.

# _____________________________________________________________________________

# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

!ONERR GOTO ERR

!SCROFF

!PROMPT

0______________________________________________________________________________

0 CODE DRILLHOLES WITH ZONECODES

0______________________________________________________________________________

!LET $IN# = _vb_holes

!LET $OUT# = DH_CODED

_______________________________________________________________________________

!INPFIL &OUT(XXCONT)

MODEL CONTROL FILE

TYPE A 8 Y ''

WIREFRAM A 24 Y ''

ZONECODE N Y -

PRIORITY N Y -

TOPCUT N Y -

GROUP N Y -

MODPAR.csv

!REM

!PICREC &IN(XXCONT), &OUT(XXCONTROL)

TYPE = "WF"  END

!SORTX &IN(XXCONTROL), &OUT(zzMODFIL),

       *KEY1(PRIORITY),

       @ORDER=1

!FILE $EX1#=zzMODFIL, $NRECS#=RECS

!LET $C# = 0

!LET $LPMAX# = $NRECS#

!LPSTART:REM

!LET $C# = {$C# + 1}

https://datamine.freshdesk.com/en/support/solutions/articles/19000088118-code-drillholes-with-wireframes-macro- 3/6
1/1/22, 10:22 AM Code Drillholes with Wireframes (Macro) : DATAMINE SOFTWARE

!ECHO LOOP $C#

!FIELD $EX1# = zzMODFIL, $CREC# = $C#,

       $TYPE# = TYPE,

       $WF# = WIREFRAM,

       $ZC# = ZONECODE,

       $PR# = PRIORITY

!SELTRI &IN($IN#),&OUT(xxsel1),&WIREPT($WF#pt),

&WIRETR($WF#tr),*X(X),*Y(Y),*Z(Z),

@SELECT=3.0,@TOLERANC=0.001

!EXTRA &IN(xxsel1), &OUT(xxgnt)

ZONECODE = $ZC#

go

!SORTX    &IN(xxgnt),&OUT(xx$C#),*KEY1(BHID),*KEY2(FROM),

          *KEY3(TO),

          @BINS=5.0,@ORDER=1.0

!IF $C#=1, THEN

!SORTX    &IN(xx$C#),&OUT(XXOUTMOD),*KEY1(BHID),*KEY2(FROM),

          *KEY3(TO),

          @BINS=5.0,@ORDER=1.0

!ELSE

!JOIN     &IN1(XXOUTMOD),&IN2(xx$C#),&OUT(xxjoin),*KEY1(BHID),*KEY2(FROM),

          *KEY3(TO),@SUBSETR=0.0,@SUBSETF=0.0,@CARTJOIN=0.0

!COPY &IN(xxjoin), &OUT(XXOUTMOD)

!ENDIF

!IF $C#<{$LPMAX#-0.5}, GOTO LPSTART

!MGSORT   &IN(XXOUTMOD),&OUT(xxsrt50),*KEY1(BHID),*KEY2(FROM),

          *KEY3(TO),@ORDER=1.0

!prompt

0_____________________________________________________________________________

0 Add Waste

0_____________________________________________________________________________

!MGSORT   &IN($IN#),&OUT(xxsrt51),*KEY1(BHID),*KEY2(FROM),

          *KEY3(TO),@ORDER=1.0      

https://datamine.freshdesk.com/en/support/solutions/articles/19000088118-code-drillholes-with-wireframes-macro- 4/6
1/1/22, 10:22 AM Code Drillholes with Wireframes (Macro) : DATAMINE SOFTWARE

!DIFFRN   &IN1(xxsrt51),&IN2(xxsrt50),

          &OUT(xxdiff1),*KEY1(BHID),*KEY2(FROM),*KEY3(TO)

!EXTRA &IN(xxdiff1), &OUT(xxgnt2)

ZONECODE = 99

go

!MGSORT   &IN(xxgnt2),&OUT(xxsrt52),*KEY1(BHID),*KEY2(FROM),

          *KEY3(TO),@ORDER=1.0

!JOIN     &IN1(xxsrt52),&IN2(xxsrt50),&OUT(xxjoin2),*KEY1(BHID),*KEY2(FROM),

          *KEY3(TO),@SUBSETR=0.0,@SUBSETF=0.0,@CARTJOIN=0.0

!SORTX    &IN(xxjoin2),&OUT($OUT#),*KEY1(BHID),*KEY2(FROM),

          *KEY3(TO),@BINS=5.0,

          @ORDER=1.0

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

 END OF MACRO

_______________________________________________________________________________

!LISTDR &OUT(XXDIR),@PRINT=0.0,@FILEDESC=0.0,@ECHO=0.0,

        XX?>-<+

!DEL &IN(XXDIR)

!PROMPT

0______________________________________________________________________________

0   MACRO COMPLETE

0   CODE DRILLHOLES

0       JL

0______________________________________________________________________________

!SCRON

!OPSYS

move errorlog.dat log_report_predata_CODE.doc

!ERR:REM

------------------------------------------------------------------------------

##############################################################################

------------------------------------------------------------------------------

!END

More information

https://datamine.freshdesk.com/en/support/solutions/articles/19000088118-code-drillholes-with-wireframes-macro- 5/6
1/1/22, 10:22 AM Code Drillholes with Wireframes (Macro) : DATAMINE SOFTWARE

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").

For more information, please contact your local Datamine representative.

https://datamine.freshdesk.com/en/support/solutions/articles/19000088118-code-drillholes-with-wireframes-macro- 6/6

You might also like