MMpy.BlockModel.get_num_block_value

Syntax

blockmodel.get_num_block_value(field_id, record_id)

Description

Returns the numeric representation of the block attribute value found at the specified position given.

Parameters

Name
Type
Description

field_id 

int The ID of the target field.

record_id 

int The ID of the target record.

Returns

Type
Description
float The numeric representation of the block attribute value found at the specified position. If not found or an incompatible type is found, 0.0 is returned.

See Also

MMpy.BlockModel.get_field_id()

MMpy.BlockModel.get_str_block_value()

Notes

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

Examples

blockmodel_filename = MMpy.Project.path() + 'Wireframing\\NVG MV1S OBM.DAT'
x_field, y_field, z_field = 'EAST', 'NORTH', 'RL'

blockmodel = MMpy.BlockModel()
blockmodel.open(blockmodel_filename, x_field, y_field, z_field)

field = 'AUAVG'
field_id = blockmodel.get_field_id(field)

record_id = 1

value = blockmodel.get_num_block_value(field_id, record_id)

print(value)

blockmodel.close()

Resource ID

IDPH_BM_GET_NUM_VALUE