Professional Documents
Culture Documents
Code Drillholes With Wireframes (Macro) - DATAMINE SOFTWARE
Code Drillholes With Wireframes (Macro) - DATAMINE SOFTWARE
KBID: DMS000004
Automation scripts and macros may not be compatible with your product & version.
Macro Description
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.:
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)
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
# requires MODPAR.csv
# _____________________________________________________________________________
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
!SCROFF
!PROMPT
0______________________________________________________________________________
0______________________________________________________________________________
_______________________________________________________________________________
!INPFIL &OUT(XXCONT)
TYPE A 8 Y ''
WIREFRAM A 24 Y ''
ZONECODE N Y -
PRIORITY N Y -
TOPCUT N Y -
GROUP N Y -
MODPAR.csv
!REM
*KEY1(PRIORITY),
@ORDER=1
!LET $C# = 0
!LPSTART:REM
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
$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
ZONECODE = $ZC#
go
!SORTX &IN(xxgnt),&OUT(xx$C#),*KEY1(BHID),*KEY2(FROM),
*KEY3(TO),
@BINS=5.0,@ORDER=1.0
!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
!ENDIF
!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)
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
!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").
https://datamine.freshdesk.com/en/support/solutions/articles/19000088118-code-drillholes-with-wireframes-macro- 6/6