### Command-Line Argument Examples Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptek.workflows.parser Illustrates how to pass various data types as command-line arguments to a Python script. Examples cover string, integer, float, datetime, and list types, demonstrating the correct syntax for each. ```bash # String with spaces "py script.py --name=\"Tim the enchanter\"" # Single-character name string "py script.py -n=\"King Arthur\"" # Boolean (True) "py script.py --pre-sorted" # Boolean (False - argument absent) "py script.py" # Integer "py script.py --count=42" # Float "py script.py --tolerance=3.14159" # Datetime (ISO-8601 format) "py script.py --time=\"2020-07-10T12:54:07\"" # List "py script.py origin=\"1, 1, 1\"" ``` -------------------------------- ### Leveling Setup and Execution API Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekgantt API endpoints for configuring and running the leveling process. ```APIDOC ## Leveling Setup and Execution API ### update_leveling_setup(_start_date : str_, _end_date : str_, _clear_previous : bool_, _minimum_split_days : int_, _minimum_split_hours : int_) Updates the leveling setup. ### Method PUT ### Endpoint /leveling/setup/update ### Parameters #### Request Body - **start_date** (str) - Optional - The date to start leveling. If start_date and end_date are both the empty string, leveling will be performed on the entire project. - **end_date** (str) - Optional - The date to end leveling. - **clear_previous** (bool) - Required - True to clear the previous leveling setup, False otherwise. - **minimum_split_days** (int) - Optional - The minimum number of days for the new split bar. - **minimum_split_hours** (int) - Optional - The minimum number of hours for the new split bar. ### Description Configures the parameters for the leveling process, including date ranges and split criteria. ### Request Example ```json { "start_date": "2023-01-01", "end_date": "2023-12-31", "clear_previous": true, "minimum_split_days": 7, "minimum_split_hours": 12 } ``` ### Response #### Success Response (200) - **update_status** (bool) - True if the leveling setup was updated successfully, False otherwise. #### Response Example ```json { "update_status": true } ``` ### run_leveling(_log_file : PathLike_) Runs leveling. ### Method POST ### Endpoint /leveling/run ### Parameters #### Request Body - **log_file** (PathLike) - Required - The path to write the leveling results to. ### Description Executes the leveling process based on the currently configured setup. ### Request Example ```json { "log_file": "/path/to/leveling.log" } ``` ### Response #### Success Response (200) - **results** (str) - A string indicating the outcome of the leveling process. #### Response Example ```json { "results": "Leveling process completed. Results logged to /path/to/leveling.log." } ``` ``` -------------------------------- ### Read and Process Block Model Data with Vulcan SDK (C++) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/Examples/reading-a-block-model This C++ code snippet demonstrates how to initialize the Vulcan SDK, open a block model file, retrieve its extents and block count, define a subset of the model (a 'match'), and iterate through blocks within that match to sum a specific numeric variable. It includes error handling and setup for the Vulcan environment. ```cpp ////////////////////////////////////////////////////////////////////////////// // // Name : VulcanSDK_blockmodel_example.cpp // Description : A basic example of using the Vulcan SDK with block models // // Maptek Pty Ltd, 2020 // ////////////////////////////////////////////////////////////////////////////// #include #include "mtkExportedApi_ReadWrite.h" int RunBlockModelExample(char* filename) { int status, i; MTK_BlockModel *bmodel; double model_x0, model_y0, model_z0, model_x1, model_y1, model_z1; double match_x0, match_y0, match_z0, match_x1, match_y1, match_z1; long long numBlocks; int numBlockVariables; char* variableName; bool foundNumericUserVariable; double variableValue, defaultValue, summedValue; printf("Initialising API using Maptek Extend licence..."); // Setup environment variable 'VULCAN' for this process to a // Vulcan installation directory for dependencies and licencing. MTK_SetVulcanEnvironmentVariable("C:/Program Files/Maptek/Vulcan 12.0.3"); // Initialise library using client-side Maptek Extend licence if (MTK_API_InitExtend()) { HandleError(); return 1; } printf("done\n"); printf("Opening block model %s...", filename); bmodel = MTK_BlockModel_Open(filename, 0); if (!bmodel) { HandleError(); return 1; } printf("done\n"); status = MTK_BlockModel_GetModelExtent( bmodel, &model_x0, &model_y0, &model_z0, &model_x1, &model_y1, &model_z1 ); if (status) { HandleError(); return 1; } printf("BlockModel extents: %.2f %.2f %.2f, %.2f %.2f %.2f\n", model_x0, model_y0, model_z0, model_x1, model_y1, model_z1); numBlocks = MTK_BlockModel_NBlocks(bmodel); if (numBlocks == -1) { HandleError(); return 1; } printf("Number of blocks in model: %lld\n", numBlocks); // This code creates a block 'match'. A block match is a subset of the // block model and can be created in various ways. In this case it is // being created by shrinking the extents. // Once a match is created, navigation calls such as NextBlock work // within the match, not the entire model. printf("Creating match for a central portion of the block model..."); match_x0 = model_x0 + ((model_x1 - model_x0) / 3); match_x1 = model_x1 - ((model_x1 - model_x0) / 3); match_y0 = model_y0 + ((model_y1 - model_y0) / 3); match_y1 = model_y1 - ((model_y1 - model_y0) / 3); match_z0 = model_z0 + ((model_z1 - model_z0) / 3); match_z1 = model_z1 - ((model_z1 - model_z0) / 3); status = MTK_BlockModel_SetMatchExtent( bmodel, match_x0, match_y0, match_z0, match_x1, match_y1, match_z1 ); if (status) { HandleError(); return 1; } printf("done\n"); printf("BlockMatch extents: %.2f %.2f %.2f, %.2f %.2f %.2f\n", match_x0, match_y0, match_z0, match_x1, match_y1, match_z1); // This code finds a numeric variable that we can use later printf("Searching for a numeric user variable..."); numBlockVariables = MTK_BlockModel_NVariables(bmodel); if (numBlockVariables == -1) { HandleError(); return 1; } foundNumericUserVariable = false; variableName = (char*)malloc(sizeof(char) * 256); for (i = 0; i < numBlockVariables; ++i) { status = MTK_BlockModel_GetVariableName(bmodel, i, variableName); if (status) { HandleError(); return 1; } status = MTK_BlockModel_IsNumber(bmodel, variableName); if (status == -1) { HandleError(); return 1; } if (status == 1) { foundNumericUserVariable = true; break; } } if (!foundNumericUserVariable) { printf("not found, so using volume\n"); sprintf(variableName, "volume"); } else { printf("found %s\n", variableName); } // This code iterates through blocks in the match, retrieving the values of // the specified variable and summing them if they are not equal to // their default value printf("Summing %s in block model match " "(ignoring default values)... ", variableName); summedValue = 0; status = MTK_BlockModel_GetDefaultNumber( bmodel, variableName, &defaultValue ); if (status) { HandleError(); return 1; } status = MTK_BlockModel_FirstBlock(bmodel); if (status) { HandleError(); return 1; } numBlocks = 0; do { numBlocks = numBlocks + 1; status = MTK_BlockModel_GetNumber( bmodel, variableName, &variableValue ); if (status) { HandleError(); return 1; } if (variableValue != defaultValue) { ``` -------------------------------- ### Reserve Attribute Setup API Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekgantt API endpoints for setting up and managing reserve attributes. ```APIDOC ## Reserve Attribute Setup API ### setup_reserve_attribute(_spec_file : PathLike_, _block_model : PathLike_, _use_resolution : bool_, _account_for_double_counting : bool_) Sets up a reserve attribute. ### Method POST ### Endpoint /reserve/attribute/setup ### Parameters #### Request Body - **spec_file** (PathLike) - Required - The path to the spec file. - **block_model** (PathLike) - Required - The path to the block model file. - **use_resolution** (bool) - Required - True to use resolution, False otherwise. - **account_for_double_counting** (bool) - Required - True to have VGS automatically remove the overlapping tons/volume/footage etc., while maintaining the original design. False to not automatically remove anything. ### Description Configures a new reserve attribute using specified files and options. ### Request Example ```json { "spec_file": "/path/to/spec.json", "block_model": "/path/to/block_model.bmf", "use_resolution": true, "account_for_double_counting": false } ``` ### Response #### Success Response (200) - **setup_successful** (bool) - True if the setup was successful, False otherwise. #### Response Example ```json { "setup_successful": true } ``` ``` -------------------------------- ### Example Attribute Matching with MatchAttribute Enum Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptek.workflows.matching Demonstrates how to use the MatchAttribute enum from the maptek.workflows.matching sub-module to define different matching schemes for workflow connectors. This example showcases BY_NAME, BY_TYPE, and DO_NOT_MATCH. ```python from maptek.workflows import ( WorkflowArgumentParser, MatchAttribute, FileConnectorType, Point3DConnectorType, BooleanConnectorType) parser = WorkflowArgumentParser("Example attribute matching") parser.declare_input_connector( "surface", FileConnectorType, connector_name="Surface", matching=MatchAttribute.BY_NAME) parser.declare_input_connector( "centroid", Point3DConnectorType, connector_name="Centroid", matching=MatchAttribute.BY_TYPE) parser.declare_input_connector( "overwrite", BooleanConnectorType, connector_name="Overwrite", matching=MatchAttribute.DO_NOT_MATCH) parser.parse_arguments() # Do something useful with the arguments. ``` -------------------------------- ### Dimension Radius Interface Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Provides methods for interacting with dimension radii, including getting and setting start, end, and normal points, as well as swapping points. ```APIDOC ## Dimension Radius Interface ### Description Interface for Vulcan design dimension radii, allowing manipulation of start, end, and normal points. ### Methods #### __init__ - **Description**: Initializes the dimension radius interface. - **Method**: POST (Assumed, as it initializes an object) - **Endpoint**: `/dimensions/radii` (Assumed) #### get_start - **Description**: Gets the dimension start point. - **Method**: GET - **Endpoint**: `/dimensions/{dimensionId}/start` (Assumed) - **Returns**: `point` - The start point of the dimension. #### set_start - **Description**: Sets the dimension start point. - **Method**: POST (Assumed) - **Endpoint**: `/dimensions/{dimensionId}/start` (Assumed) - **Parameters**: - **point** (`point`) - Required - The start point to set. #### get_end - **Description**: Gets the dimension end point. - **Method**: GET - **Endpoint**: `/dimensions/{dimensionId}/end` (Assumed) - **Returns**: `point` - The end point of the dimension. #### set_end - **Description**: Sets the dimension end point. - **Method**: POST (Assumed) - **Endpoint**: `/dimensions/{dimensionId}/end` (Assumed) - **Parameters**: - **point** (`point`) - Required - The end point to set. #### get_normal - **Description**: Gets the dimension normal direction. - **Method**: GET - **Endpoint**: `/dimensions/{dimensionId}/normal` (Assumed) - **Returns**: `point` - The normal direction of the dimension. #### set_normal - **Description**: Sets the dimension normal direction. - **Method**: POST (Assumed) - **Endpoint**: `/dimensions/{dimensionId}/normal` (Assumed) - **Parameters**: - **point** (`point`) - Required - The normal direction to set. #### swap_points - **Description**: Swaps the dimension start and end points. - **Method**: POST (Assumed) - **Endpoint**: `/dimensions/{dimensionId}/swap_points` (Assumed) ### Properties #### _property _start_ - **Description**: Dimension start point. - **Type**: `point` #### _property _end_ - **Description**: Dimension end point. - **Type**: `point` #### _property _normal_ - **Description**: Dimension normal direction. - **Type**: `point` #### _property _arrow_length_ - **Description**: Dimension arrow length. - **Type**: `float` #### _property _arrow_width_ - **Description**: Dimension arrow width. - **Type**: `float` #### _property _attributes_ - **Description**: Object attribute data. - **Type**: `attributes` #### clear - **Description**: Clear out an object’s data. - **Method**: DELETE (Assumed) - **Endpoint**: `/objects/{objectId}` (Assumed) #### _property _colour_ - **Description**: Object colour. - **Type**: `int` #### _property _description_ - **Description**: Object description. - **Type**: `str` #### _property _feature_ - **Description**: Object feature code. - **Type**: `str` #### _property _font_ - **Description**: Dimension font. - **Type**: `str` ``` -------------------------------- ### Go To Table Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Move to a specified table name by finding the start of the specified table name within the current key. ```APIDOC ## POST /websites/help_maptek_vulcansdk_2025/goto_table ### Description This is a function that will move to a specified table name by moving to the beginning of the current key and finding the start of the specified table name. ### Method POST ### Endpoint `/websites/help_maptek_vulcansdk_2025/goto_table` ### Parameters #### Request Body - **table** (str) - Required - Table name to be found. ### Response #### Success Response (200) - **success** (bool) - True on success and position of current record is set. #### Response Example ```json { "success": true } ``` ### Raises - **NameError** - When no table found with the matching name. ### Example Usage ```python # Goes to a requested table name db.goto_table("SURVEY") ``` ``` -------------------------------- ### C++ Vulcan SDK Triangulation Example Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/Examples/creating-a-simple-triangulation This C++ code demonstrates basic operations with the Vulcan SDK's triangulation functionality. It initializes the API, opens a triangulation file, validates it, retrieves point and texture information, accesses attribute data, and adds new points to form a box. It requires the Vulcan SDK and a Maptek Extend license. ```cpp ////////////////////////////////////////////////////////////////////////////// // // Name : VulcanSDK_triangulation_example.cpp // Description : A basic example of using the Vulcan SDK with triangulations // // Maptek Pty Ltd, 2020 // ////////////////////////////////////////////////////////////////////////////// #include #include #include #include "mtkExportedApi_ReadWrite.h" int RunTriangulationExample(char* filename) { int status, i; char newFilename[MTK_BUFFER_SIZE]; char texture_file[MTK_BUFFER_SIZE]; MTK_Triangulation *triang; int numPoints, numAttributes; double pointX, pointY, pointZ; double maxX, maxY, maxZ; char* extension; printf("Initialising API using Maptek Extend licence..."); // Setup environment variable 'VULCAN' for this process to a // Vulcan installation directory for dependencies and licencing. MTK_SetVulcanEnvironmentVariable("C:/Program Files/Maptek/Vulcan 12.0.3"); // Initialise library using client-side Maptek Extend licence if (MTK_API_InitExtend()) { HandleError(); return 1; } printf("done\n"); printf("Opening triangulation %s...", filename); triang = MTK_Triangulation_Open(filename); if (!triang) { HandleError(); return 1; } printf("done\n"); status = MTK_Triangulation_IsValid(triang); if (status != 1) { if (status == -1) { HandleError(); } else { printf("Triangulation %s is not valid.\n", filename); } return 1; } printf("Triangulation %s is valid\n", filename); numPoints = MTK_Triangulation_NumPoints(triang); if (numPoints == -1) { HandleError(); return 1; } printf("Triangulation %s has %d points\n", filename, numPoints); // Check if the triangulation has a texture if (MTK_Triangulation_GetTexture(triang, texture_file)) { HandleError(); return 1; } else { printf("Triangulation %s has a texture file: '%s'\n", filename, texture_file); } int iTextured = MTK_Triangulation_IsTextured(triang); if (iTextured == -1) { HandleError(); return 1; } else { if (iTextured == 1) { printf("Triangulation %s has texture turned on\n", filename); } else { printf("Triangulation %s has texture turned off\n", filename); } } // Create buffer for holding attribute names char** names = (char**)malloc(sizeof(char*) * MTK_BUFFER_SIZE); for (int i = 0; i < MTK_BUFFER_SIZE; ++i) { names[i] = (char*)malloc(sizeof(char) * MTK_BUFFER_SIZE); } if (MTK_Triangulation_GetAttributeNames(triang, names, &numAttributes)) { HandleError(); return 1; } printf("Triangulation %s has %d attributes\n", filename, numAttributes); printf("Printing out all attributes of type DOUBLE:\n"); for (int i = 0; i < numAttributes; ++i) { MTK_Triangulation_AttributeType type; if (MTK_Triangulation_GetAttributeType(triang, names[i], &type)) { HandleError(); continue; } if (type == TRI_ATTRIBUTE_DOUBLE) { double dval; if (!MTK_Triangulation_GetAttributeAsDouble(triang, names[i], &dval)) { printf("Triangulation attribute %s (type DOUBLE) has value:" " %.10f\n", names[i], dval); } else { char error[MTK_BUFFER_SIZE]; MTK_API_GetError(error); printf("%s (Triangulation attribute %s)\n", error, names[i]); } } } // Free the attribute names buffer for (int i = 0; i < MTK_BUFFER_SIZE; ++i) { free(names[i]); } free(names); // This code finds the 'highest' point in the triangulation, then adds a // small box a bit 'above' that point to the triangulation printf("Adding small box to triangulation..."); maxX = -DBL_MAX; maxY = -DBL_MAX; maxZ = -DBL_MAX; for (i = 0; i < numPoints; ++i) { status = MTK_Triangulation_GetPoint( triang, i, &pointX, &pointY, &pointZ ); if (status) { HandleError(); return 1; } if (pointX > maxX) { maxX = pointX; } if (pointY > maxY) { maxY = pointY; } if (pointZ > maxZ) { maxZ = pointZ; } } maxX += 50; maxY += 50; maxZ += 50; // '50' is completely arbitrary MTK_Triangulation_AddPoint(triang, maxX, maxY, maxZ); // numPoints MTK_Triangulation_AddPoint(triang, maxX + 50, maxY, maxZ); // numPoints + 1 MTK_Triangulation_AddPoint(triang, maxX + 50, maxY + 50, maxZ); // numPoints + 2 MTK_Triangulation_AddPoint(triang, maxX, maxY + 50, maxZ); // numPoints + 3 return 0; } ``` -------------------------------- ### Get All Triangulation Attribute Keys (Python) Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Returns a list of all attribute keys currently associated with the triangulation. ```python def get_keys(self) -> list[str]: """ Get the list of attribute keys associated with the triangulation. Returns: The attribute keys. Return type: list[str] """ pass ``` -------------------------------- ### Get Arrow Start Location (C++) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/design-functions/arrow-functions Retrieves the start coordinates (x, y, z) of an arrow object. The function takes a pointer to an MTK_Object and pointers to doubles to store the coordinates. ```cpp int MTK_Object_Arrow_GetStart( MTK_Object* obj, double* x, double* y, double* z ); ``` -------------------------------- ### Get Grid Origin Y-coordinate Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Retrieves the y-coordinate of the grid's origin. This function returns a float value representing the starting y-position of the grid. ```python get_y0() → float Get the y value of the origin of the grid. ``` -------------------------------- ### Create Basic GPAN Panel using Vulcan GUI Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-python-sdk/example-snippets/gui-interface This example demonstrates creating a basic GPAN panel for file selection. It defines the panel structure in a string, compiles it using `pc.exe`, displays it using `vulcan_gui.gpan`, and retrieves the selected values. Dependencies include `maptek.vulcan_gui`, `os.environ`, `subprocess`, and `pathlib.Path`. It cleans up generated files afterwards. ```python from maptek import vulcan_gui from os import environ, remove import subprocess from pathlib import Path gpan_string = ''' panel example { borders = 10; title = "Pick an input file"; block foo { drawbox = true; fileselector file { width = 50; label = "Input file"; filter = "__filelist("",*.bmf)"; wildcard = "Block Model (*.bmf)|*.bmf"; } } button ok { label = "Ok"; } button cancel { label = "Cancel"; } } ''' # Compile the gpan file into a cgp file gpan_file = "example.gpan" cgp_file = "example.cgp" with open(gpan_file, "w") as out: out.write(gpan_string) gpan_compiler = Path(environ["VULCAN_EXE"], "pc.exe") subprocess.run([str(gpan_compiler), gpan_file], check=True) # Display the panel pan = vulcan_gui.gpan() pan.display(cgp_file, "example") print (pan.values) # Remove the generated gpan files remove(gpan_file) remove(cgp_file) ``` -------------------------------- ### Get Grid Origin X-coordinate Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Retrieves the x-coordinate of the grid's origin. This function returns a float value representing the starting x-position of the grid. ```python get_x0() → float Get the x value of the origin of the grid. ``` -------------------------------- ### Get Dimension Line Start Position (C) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/design-functions/dimension-line-functions Retrieves the start coordinates (x, y, z) of a dimension line object. It takes a pointer to an MTK_Object and pointers to double variables to store the coordinates. Returns 0 on success. ```c int MTK_Object_DimensionLine_GetStart( MTK_Object* obj, double* x, double* y, double* z ); ``` -------------------------------- ### Load an existing Isis design from file Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Loads an existing Isis design from a specified file path. Raises OSError if the file cannot be found. ```python _static _load_design(_design_file : str_) → isis_design """ Load an existing design. Parameters: design_file (str) – The path of the existing design file to load. Returns: The loaded design. Return type: isis_design Raises: OSError – If design_file can’t be found. """ pass ``` -------------------------------- ### Add Design Data to Vulcan Database (C++) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/Examples/adding-to-a-database This C++ example demonstrates how to initialize the Vulcan SDK, open a design database in write mode, create a new polyline object with specified points and attributes, create a new layer, add the polyline to the layer, save the layer to the database, and finally close the database and terminate the API. It includes error handling for each API call. ```cpp ////////////////////////////////////////////////////////////////////////////// // // Name : VulcanSDK_design_example.cpp // Description : A basic example of using the Vulcan SDK with design data // // Maptek Pty Ltd, 2020 // ////////////////////////////////////////////////////////////////////////////// #include #include "mtkExportedApi_ReadWrite.h" int RunDesignExample(char* filename) { int status, i; MTK_Database* database; MTK_Layer* layer; MTK_Object* object; printf("Initialising API using Maptek Extend licence..."); // Setup environment variable 'VULCAN' for this process to a // Vulcan installation directory for dependencies and licencing. MTK_SetVulcanEnvironmentVariable("C:/Program Files/Maptek/Vulcan 12.0.3"); // Initialise library using client-side Maptek Extend licence if (MTK_API_InitExtend()) { HandleError(); return 1; } printf("done\n"); printf("Opening design database %s...", filename); database = MTK_Database_Open(filename, DESIGN_MODE_WRITE); if (!database) { HandleError(); return 1; } printf("done\n"); // This code creates a new polyline that happens to be in the form of a // triangle printf("Creating a new polyline..."); object = MTK_Object_New(); if (!object) { HandleError(); return 1; } status = MTK_Object_SetType(object, DESIGN_POLYLINE); if (status) { HandleError(); return 1; } status = MTK_Object_Polyline_AppendPoint( object, 78000, 4500, 0, // Coordinate 0, // w value 0, // Whether or not to draw to the point "" // Point name ); if (status) { HandleError(); return 1; } for (i = 5; i <= 50; i = i + 5) { status = MTK_Object_Polyline_AppendPoint( object, (double)(i + 78000), double(i + 4500), double(i), 0, 1, "" ); if (status) { HandleError(); return 1; } } status = MTK_Object_Polyline_AppendPoint(object, 78050, 4550, 0, 0, 1, ""); if (status) { HandleError(); return 1; } status = MTK_Object_Polyline_SetAttributes( object, -1, // Leave linetype default -1, // Leave pattern default -1, // Leave orientation default 1 // Set 'closed' to true ); if (status) { HandleError(); return 1; } printf("done\n"); // This code creates a new layer with an arbitrary name/description and // adds the new polyline to it printf("Creating a new layer and adding that polyline to it..."); layer = MTK_Layer_New(); if (!layer) { HandleError(); return 1; } status = MTK_Layer_SetName(layer, "ExampleLayer"); if (status) { HandleError(); return 1; } status = MTK_Layer_SetDescription(layer, "Layer created in VulcanSDK example"); if (status) { HandleError(); return 1; } status = MTK_Layer_AppendObject(layer, object); if (status) { HandleError(); return 1; } printf("done\n"); printf("Saving that layer to database %s...", filename); status = MTK_Database_SaveLayer(database, layer); if (status) { HandleError(); return 1; } printf("done\n"); if (MTK_Database_Close(database)) { HandleError(); return 1; } MTK_API_Terminate(); return 0; } static void HandleError() { char error[MTK_BUFFER_SIZE]; MTK_API_GetError(error); printf("%s\n", error); MTK_API_Terminate(); } ``` -------------------------------- ### Block Model Initialization Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Instantiate a new block model object, either loading an existing one or creating a new one. ```APIDOC ## POST /websites/help_maptek_vulcansdk_2025/block_model ### Description Instantiate a new block model object. This can either load an existing block model from file or create a new one. ### Method POST ### Endpoint `/websites/help_maptek_vulcansdk_2025/block_model` ### Parameters #### Request Body - **name** (str) - Required - The file path of the block model to open. If attempting to load an existing model, this file must exist. If attempting to create a new model, this file must not exist. - **mode** (str) - Optional - Mode to open the block model. Options are ‘w’ - write mode ‘r’ - read mode ‘create’ - create mode. Defaults to 'w'. - **env_deprecated** (str) - Optional - Project environment - deprecated, included only for backwards compatibility. ### Response #### Success Response (200) - **block_model_object** (object) - The block model object. #### Response Example ```json { "block_model_object": "" } ``` ### Raises - **OSError** - If the model is unable to be opened. ``` -------------------------------- ### Get Dimension Radius Start Location (C) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/design-functions/dimension-radius-functions Retrieves the start coordinates (x, y, z) of a dimension radius object. This function accepts a pointer to an MTK_Object and pointers to double variables to store the coordinates. It returns 0 on successful execution. ```c int MTK_Object_DimensionRadius_GetStart( MTK_Object* obj, double* x, double* y, double* z ); ``` -------------------------------- ### Arrow Object Methods (Python) Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Defines methods for interacting with arrow objects, including getting and setting the start point, end point, normal, and scale. It also provides functionality to manage auto-scaling settings. ```python get_start() → point set_start(_point : point_) get_end() → point set_end(_point : point_) get_normal() → point set_normal(_point : point_) get_scale() → str set_scale(_scale : str_) is_auto_scale() → bool set_auto_scale(_autoscale : bool = True_) is_filled() → bool ``` -------------------------------- ### Create Panel with Input Fields using Vulcan GUI Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-python-sdk/example-snippets/gui-interface This example shows how to create a custom panel with various input fields like text boxes, a number input, and a dropdown using `vulcan_gui.panel`. It also demonstrates saving and loading the panel's specification. Dependencies include `maptek.vulcan_gui`. The panel includes fields for text, numbers, and a letter selection. ```python # >>> [Indicates sample output.] from maptek import vulcan_gui spec_name = "panel_example_spec.abc" pan = vulcan_gui.panel("My Data Input Panel") pan.load_spec(spec_name) pan.statictext("Enter values below", bold=True) pan.editbox("edit_val", "Enter some text") pan.editbox("num_val", "Enter a number") pan.combobox("combo", "Pick a letter", options=['a','b','c','d']) pan.display() pan.save_spec(spec_name) print (pan.values) # >>> {'combo': 'a', 'num_val': '12345', 'edit_val': 'Hello'} ``` -------------------------------- ### Get Triangulation Color (Python) Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Retrieves the color of a triangulation, which can be either an RGB list (length 3) or a color index. The example demonstrates setting RGB color and then retrieving it, followed by setting a color index and retrieving that. ```python tri.set_rgb([255,255,255]) tri.get_colour() [255, 255, 255] tri.set_colour_index() tri.get_colour() 1 ``` -------------------------------- ### Initialize Vulcan SDK and Set Environment Variable (C#) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/Examples/creating-a-simple-triangulation.net Initializes the Vulcan SDK by setting the environment variable and attempting to initialize with an Extend license. Returns true on success, false otherwise. It relies on MTK_SetVulcanEnvironmentVariable and MTK_API_InitExtend functions. ```csharp if (MTK_SetVulcanEnvironmentVariable(path) == 0) { if (MTK_API_InitExtend() == 0) { Console.WriteLine("Library initialised"); return true; } else { Console.WriteLine("Failed to initialise with Extend license"); } } else { Console.WriteLine("Failed to set Vulcan Environment Variable"); } return false; ``` -------------------------------- ### Create a Closed Polygon in DGD Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-python-sdk/example-snippets/dgd-reading-writing Opens a DGD file, gets a layer, and adds a closed square-shaped polygon. This example utilizes the `set_closed()` method to ensure the polygon is rendered as a closed shape. ```python from maptek import vulcan with vulcan.dgd('pydemo.dgd.isis','w') as dgd: layer = dgd.get_layer('DEMO') # get the "DEMO" layer obj = vulcan.polyline([[5,0],[7,0],[7,2],[5,2]]) obj.name = 'SQUARE' obj.set_colour(5) obj.set_connected() obj.set_closed() layer.append(obj) dgd.save_layer(layer) ``` -------------------------------- ### Get Dimension Arc Radius (C) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/design-functions/dimension-arc-functions Retrieves the radius coordinates (start of the arc) (x, y, z) of a dimension arc object. Requires a pointer to an MTK_Object and pointers to double variables to store the coordinates. ```c int MTK_Object_DimensionArc_GetRadius( MTK_Object* obj, double* x, double* y, double* z ); ``` -------------------------------- ### Get Dimension Angle Radius (C) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/design-functions/dimension-angle-functions Retrieves the radius (start) location of a dimension angle object. Requires a pointer to an MTK_Object and output variables for x, y, and z coordinates. Returns 0 on success. ```c int MTK_Object_DimensionAngle_GetRadius( MTK_Object* obj, double* x, double* y, double* z ); ``` -------------------------------- ### Create a DGD File with a Point Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-python-sdk/example-snippets/dgd-reading-writing Demonstrates creating a new DGD file, adding a layer named 'DEMO', and inserting a single point object. The object's name and color can be customized. ```python from maptek import vulcan with vulcan.dgd('pydemo.dgd.isis', 'create') as dgd: layer = vulcan.layer('DEMO') # create a new layer called DEMO obj = vulcan.polyline([0,0,0]) # add a single point obj.name = 'POINT' # change the name of the point to "POINT" obj.set_colour(1) # change the colour to colour 1 layer.append(obj) # add to the layer dgd.append(layer) # add the layer to the dgd ``` -------------------------------- ### Get Raw Collar Coordinates Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekdrillholes Accesses the raw collar point of the drillhole, which represents its starting position without any coordinate system adjustments. This is useful for initial data loading or specific coordinate system-independent analyses. ```python drillhole._raw_collar ``` -------------------------------- ### Create New Blast Source - Python Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekblasts Creates a new drill and blast database at the specified file path. The file path should end with '.dgd.isis'. ```python blast_source.create(_database = "path/to/new_database.dgd.isis") ``` -------------------------------- ### Load Window Definition (Python) Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan_guigfx Loads a predefined window configuration into the currently active graphics window. This function requires the name of the window definition as a string parameter. ```python import maptek.vulcan_gui.gfx # Assuming 'MY_WINDOW_DEF' is a valid window definition name success = maptek.vulcan_gui.gfx.load_window_from_definition('MY_WINDOW_DEF') ``` -------------------------------- ### Get Numeric Variable Value (C) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/block-model-functions/variable-functions Retrieves the current double value for a specified variable in a block model. It requires a pointer to the MTK_BlockModel, the variable name, and a pointer to store the value. Returns 0 on success, non-zero on failure. Includes an example demonstrating its usage. ```c int MTK_BlockModel_GetNumber( MTK_BlockModel* bmodel, const char* varName, double* value ); // MTK_BlockModel_GetNumber Example int main() { int status; // Authorisation code // Open a block model and get an MTK_BlockModel* // Navigate to the desired block double value; status = MTK_BlockModel_GetNumber(bmodel, "someVariable", &value); if (status) { char error[MTK_BUFFER_SIZE]; MTK_API_GetError(error); printf("%s\n", error); return 1; } // Do something with that value // Close the block model return 0; } ``` -------------------------------- ### Load Window from Definition Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan_guigfx Loads a specified window definition into the active window. ```APIDOC ## POST /load_window_from_definition ### Description Loads a window definition to the active window. ### Method POST ### Endpoint /load_window_from_definition ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **window_def** (str) - The name of the window definition to load. ### Request Example ```json { "window_def": "TEST.DG1" } ``` ### Response #### Success Response (200) - **result** (bool) - True if the window definition was loaded successfully, False otherwise. #### Response Example ```json { "result": true } ``` ``` -------------------------------- ### Get Current Key Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Get the key at the current record position. ```APIDOC ## GET /websites/help_maptek_vulcansdk_2025/_property_this_key ### Description Get the current position key. ### Method GET ### Endpoint `/websites/help_maptek_vulcansdk_2025/_property_this_key` ### Response #### Success Response (200) - **current_key** (str) - The key at the current record position. #### Response Example ```json { "current_key": "LK177" } ``` ``` -------------------------------- ### Set Dimension Line Start Point (C++) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/design-functions/dimension-line-functions Sets the starting coordinates of a dimension line object. Requires a pointer to the MTK_Object and the x, y, and z coordinates of the start point. Returns 0 on success, non-zero on failure. ```c++ int MTK_Object_DimensionLine_SetStart( MTK_Object* obj, const double& x, const double& y, const double& z ); ``` -------------------------------- ### Set Arrow Start Location (C++) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/design-functions/arrow-functions Defines the starting point of an arrow object in 3D coordinates. This function takes a pointer to the MTK_Object and the x, y, and z coordinates of the start location. It returns 0 upon successful completion. ```c++ int MTK_Object_Arrow_SetStart( MTK_Object* obj, const double& x, const double& y, const double& z ); ``` -------------------------------- ### Reset View and Fit to World (Python) Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan_guigfx Resets the current view to a plan (top-down) orientation and fits all loaded data within the window. Optionally, a specific window name can be provided; otherwise, it defaults to the current window. Returns a boolean indicating success. ```python import maptek.vulcan_gui.gfx # Reset and fit the current window success = maptek.vulcan_gui.gfx.view_reset_and_fit_to_world() # Reset and fit a specific window named 'MAIN_VIEW' # success = maptek.vulcan_gui.gfx.view_reset_and_fit_to_world('MAIN_VIEW') ``` -------------------------------- ### Set Dimension Radius Start Location (C) Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-cpp-runtime-api/design-functions/dimension-radius-functions Sets the start coordinates (x, y, z) of a dimension radius object. This function requires a pointer to an MTK_Object and the new start coordinates. It returns 0 on successful update. ```c int MTK_Object_DimensionRadius_SetStart( MTK_Object* obj, const double& x, const double& y, const double& z ); ``` -------------------------------- ### Initialize Vulcan Grid Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekvulcan Constructs a new Vulcan grid. This can be done by creating an empty 1x1 grid, loading an existing grid from a file by its name, or by specifying detailed dimensions (origin, cell size, and number of cells). ```python __init__(_self_) → 'None' Construct a new 1x1 grid with no values. Overload __init__(self, name: ‘str’) -> ‘None’ Load a grid file if it exists, otherwise construct a new 1x1 grid with no values. Parameters: **name** (`str`) – The grid file to load, or the name to assign to the new grid. Overload __init__(self, x0: ‘float | int’, y0: ‘float | int’, dx: ‘float | int’, dy: ‘float | int’, nx: ‘int’, ny: ‘int’) -> ‘None’ Construct a new grid with given dimensions. Parameters: * **x0** (`float`) – The x value of the origin of the grid. * **y0** (`float`) – The y value of the origin of the grid. * **dx** (`float`) – The size of the grid cells in the x direction. * **dy** (`float`) – The size of the grid cells in the y direction. * **nx** (`int`) – The number of cells in the x direction. * **ny** (`int`) – The number of cells in the y direction. ``` -------------------------------- ### Manage Gantt Project State (Python) Source: https://help.maptek.com/vulcansdk/2025/api-reference/vulcan-python-sdk/maptekgantt Provides functions to interact with the active activity and project file. `find_uaid` sets the current active activity by its ID, and `get_uaid` retrieves the unique ID of the currently active activity. `project_filename` gets the project's file path or name. ```python find_uaid(_id : int_) → bool get_uaid() → int project_filename(_short_path : bool_) → str ``` -------------------------------- ### Install maptekomf-vulcan Python Package Source: https://help.maptek.com/vulcansdk/2025/topics/vulcan-python-sdk/open-mining-format Installs the necessary Python package for OMF integration with Vulcan. This command should be run from a Vulcan tcsh command line. ```bash python -m pip install maptekomf-vulcan ```