Contact Surface Modelling Automation

Calling surface-from-samples using a scripting language

Create Contact Surface: Automation

This topic is aimed at users familiar with COM-aware scripting languages, and the surface-from-samples command.

For an overview of scripting in this product, please refer to your scripting tutorial (Help | Scripting Tutorial).

 

Command Scripting Overview

The following information relates to the vein-from-samples and surface-from-samples commands.

The Create Vein Surface task is a focussed tool for the calculation of hanging wall (HW) and/or footwall (FW) surfaces that represent vein or vein-like lodes. Similarly, the Create Contact Surface task is used to generate contact surfaces between groups of contiguous categorical values.

The surface-from-samples command features a rich COM interface that allows virtually all of the interactive options of vein modelling to be accessed from a script.

As with many scriptable commands in Studio products, you can access vein-from-samples using the ParseCommand() method, followed by a series of parameters that control the output.

This Help topic contains the following sections:

Scripted Command Setup

As with the interactive usage of the command, data must be loaded into memory before it can be accessed by the vein-from-samples command. Once a DmApplication object has been instantied (e.g. using "window.external;"), there are multiple ways to load data, including the LoadFile() and LoadFromProject() methods, e.g.:

var objHoles = oDmApp.ActiveProject.Data.LoadFile("C:\\Database\\Drillholes.dm")

var objHoles = oDmApp.ActiveProject.Data.LoadFromProject("Drillholes")

Command Syntax

The general syntax for this command is:

surface-from-samples [Drillhole Object] [Field Name] [Above Values] [Parameter string]

Where:

[Drillhole Object] is a mandatory parameter and is a fully-qualified object name as it appears in the Sheets control bar, e.g.:

"Drillholes=MyHoles (drillholes);"

[Field Name] is a mandatory parameter and is the name of the attribute containing the value to be modelled , e.g.:

"Fieldname=ROCK"

[Above Values] is a mandatory parameter containing semi-colon-separated values qualified with an "AboveDatum=" prefix. For example; AboveDatum=0;AboveDatum=1;AboveDatum=2;

[Parameter String] is a semi-colon-separated string of parameters, all of which are optional, used to control how a surface or volume is generated. If no parameter value is listed, the default value will be used, e.g.:

"BoundaryObject="MyString (strings)";ClippingType="BoundaryString";Resolution="High";UseFirst=no;Output="MyOutputFile";"

For more information on command parameters, plus examples, see the following sections.

Command Parameters

The parameter string for vein-from-samples can contain any of the following items. All parameters must be separated by a semi-colon (;). No parameters are mandatory as default values will be used if any are absent.

Any data objects referenced within parameters must exist in memory before the command is called from script.

Parameter

Description

Default

Example
Data Context

Drillholes (Mandatory)

References the loaded drillholes object.

null

Drillholes=MyHoles (drillholes)

FieldName (Mandatory)

The attribute containing the value to be modelled

null

Fieldname=ROCK

AboveValues (Mandatory)

A semi-colon-separated list of prefixed values, which can be either numeric or alphanumeric

null

vAboveValues = "AboveDatum=0;AboveDatum=1;AboveDatum=2;"

IgnoreDatum(Optional)

A semi-colon-separated list of prefixed values, which can be either numeric or alphanumeric

null

vIgnoreValues= "IgnoreDatum=Value1;IgnoreDatum=Value2;"

Edit Samples
       

UseEndOfHolePoints

Determines if the end-of-hole is used as a FW point if no other FW exists on the sample(s). Either yes or no.

yes

UseEndOfHolePoints=no

UseFirst

Determines if the first or last intercept position (Above/Below boundary) is used to position a contact surface point

yes

UseFirst=no

Additional Points

AdditionalPointsObject

The full name of a loaded strings object. If not defined, no additional points will be used.

null

AdditionalPointsObject=Additional_Points_Drillholes (strings)

AdditionalPointsUncertaintyColumn

A numeric attribute of the AdditionalPointsObject (see above) describing per-point uncertainty values. If absent, DefaultUncertainty will be used.

null

AdditionalPointsUncertaintyColumn=UNCERCOL

Boundary

ClippingType

Defines the type of boundary shaping to be applied. The following values are accepted:

  • AlphaShape: use alpha shape clipping, using the ClippingParameter value to set the Extension distance and the SegmentLength parameter to control Segment length.

  • AlignedSquare: clip to a bounding cuboid, potentially extended by the ClippingParameter distance.

  • Custom: clip to a nominated boundary string. If specified, BoundaryObject must also be specified.

  • AlphaShape: Automatically Calculated

  • AlignedSquare: 50

  • Custom: n/a

ClippingType=AlphaShape;ClippingParameter=25;SegmentLength=90

ClippingType=AlignedSquare;ClippingParameter=50

ClippingType=Radius;ClippingParameter=10

ClippingType=RadialInterp;ClippingParameter=10

ClippingType=BoundaryString; BoundaryObject=MyBoundary (strings)

BoundaryObject

Mandatory if ClippingType=Custom. Denotes a loaded closed string to serve as a boundary limit.

Important: the boundary string must contain a field with an attribute name that matches FieldName. The values within this field will denote independent boundary strings. Even if your string object contains a single, closed string, this attribute must be present in order to apply a custom boundary via scripting.

null

ClippingType=BoundaryString; BoundaryObject=MyBoundary (strings)

Faults

FaultObject

A loaded wireframe object containing fault data. Multiple fault wireframes within the file can be attributed by a unique FaultIDColumn value.

null

FaultObject=Fault_Sheet_Flattr/fault_sheet_flatpt (wireframe)

FaultIDColumn

Attribute that denotes independent fault sheets in the FaultObject.

If not specified, the fault wireframe will be considered as a single fault sheet.

null

FaultIDColumn=SURF

Output

Output

The name of the wireframe object to be created.

"VeinSurf_[Attribute]_[Value]"

OutputVeinFile=MyVein"

SuppressOutput

Define if summary information is exported to the Output window when vein-from-samples is executed.

Permitted values are "yes" or "no"

no

SuppressOutput=yes

 

Notes

note.gif (1017 bytes)
  • surface-from-samples parameters set by script will not be reinstated to the user interface when subsequently using the command interactively.
  • Where field values are specified by script, the current long field name settings for your system will be honoured; attribute names will be restricted to either 8 or 24 characters depending on the current setting.
  Example  

In the following example, a file called "_vb_holes_edited.dm" is loaded from the project directory and referenced as a loaded object.

The aim is to  model the contact surface between two groups of lithological values held in an NLITH attribute; 0, 1  and 2 represent all "above" values and the remainder (2, 3 and 4, although these aren't stated explicitly - they are established as "below" by their lack of inclusion in the "above" list).

The output volume is clipped according to its alpha shape. Unless otherwise specified, default parameter values are used.

Finally, the output object is saved to disk as a wireframe pair file.

var oDmApp=window.external;

var objHoles=mApp.ActiveProject.Data.LoadFile("C:\\Database\\MyProjectFolder\\_vb_holes_edited.dm")

var vDrillholes = "_vb_holes_edited (drillholes);";

var vFieldName = "Fieldname=NLITH;";

var vAboveValues = "AboveDatum=0;AboveDatum=1;AboveDatum=2;";

var vIgnoreValues = "IgnoreDatum=Int1;IgnoreDatum=In2;"

var vClipType = "AlphaShape";

var vClipRadius = 40;

var vOutput = "contact_surface_007";

var vCommand = "vein-from-samples " + vDrillholes + vFieldName + vAboveValues + vIgnoreValues;

var vExtras = "ClippingType=" + vClipType +

    "; ClippingParameter=" + vClipRadius +

    "; Output=" + vOutput +

    "; UseFirst=no" +

    "; UseEndOfHolePoints=no" +

    ";"

oDmApp.ParseCommand(vCommand+vExtras);

var saveobj = oDmApp.ActiveProject.Data.IsLoaded(vOutput);

saveobj.SaveAsDatamineFile(vOutput, oDmApp.ActiveProject.ExtendedPrecision, true, ""); //save to physical file

 

   openbook.gif (910 bytes)  Related Topics

 

Create Contact Surface