MMpy.BlockModel.get_block_coordinates

Syntax

blockmodel.get_block_coordinates(record_id)

Description

Get the coordinates and dimensions of a block in a block model. Returns a tuple of 2 items.

Parameters

Name
Type
Description

record_id 

int The ID of the target record.

See Also

MMpy.Point3D()

Returns

Type
Description
(MMpy.Point3D, MMpy.Point3D) 3D point coordinates, Block dimensions (size).

Notes

Record IDs are 1-based, meaning passing an index of 1 will return the first record.

Examples

blockmodel_filename = MMpy.Project.path() + 'NVG MV1S OBM.DAT' x_field, y_field, z_field = 'East', 'North', 'RL' blockmodel = MMpy.BlockModel() if not blockmodel.open(blockmodel_filename, x_field, y_field, z_field): raise IOError('Error: problem opening file') coordinates, size = blockmodel.get_block_coordinates(1) print(f'Coordinates: {coordinates.x}, {coordinates.y}, {coordinates.z}') print(f'Size: {size.x}, {size.y}, {size.z}') blockmodel.close()

Resource ID

IDPH_BM_GET_COORDS