mapteksdk.data.block_utilities module

Utilities related to block models.

create_dense_model_from_definition(project, definition_id, use_primary_blocks=True)

Create a dense block model from a block model definition.

By default, this will ignore any subblocking defined in the block model definition.

Parameters:
  • project (Project) – Project to use to create the dense block model.

  • definition_id (ObjectID[BlockModelDefinition]) – Object ID of the block model definition to use as a template for the dense block model.

  • use_primary_blocks (bool) – If True (default), any subblocking in the block model definition will be ignored. If False and the block model definition defines subblocks, the subblock size will be used instead of the primary block size. This effectively creates a dense block model from the subblocks defined in the definition.

Return type:

ObjectID[DenseBlockModel]

create_subblocked_model_from_definition(project, definition_id, use_primary_blocks=True)

Create a subblocked block model from a block model definition.

By default, the returned subblocked block model will be filled with primary blocks.

Parameters:
  • project (Project) – Project to use to create the subblocked block model.

  • definition_id (ObjectID[BlockModelDefinition]) – Object ID of the block model definition to use as a template for the subblocked block model.

  • use_primary_blocks (bool) – If True (default), the returned subblocked block model will be filled with primary blocks. If False, the returned subblocked block model will be filled with subblocks.

Return type:

ObjectID[SubblockedBlockModel]

create_model_from_definition(project, definition_id, use_primary_blocks=True)

Create a block model from a block model definition.

This will create a DenseBlockModel if the block model definition does not have a subblock schema and a SubblockedBlockModel if the block model definition has one.

Parameters:
  • project (Project) – Project to use to create the block model.

  • definition_id (ObjectID[BlockModelDefinition]) – Object ID of the block model definition to use as a template for the block model.

  • use_primary_blocks (bool) – If True (default), the returned subblocked block model will be filled with primary blocks. If False, the returned subblocked block model will be filled with subblocks. Has no effect if the block model definition defines a dense block model.

Return type:

ObjectID[DenseBlockModel] | ObjectID[SubblockedBlockModel]

Notes

The origin of a block model is determined based on the primary block in the zeroth row, slice and column.

  • Block model definitions consider the far corner of this block to be the origin (i.e. This is the only corner which does not border any blocks).

  • Block models consider the centre of this block to be the origin.

Because of the above disagreement, the origin of the created block model will not be the same as the origin of the block model definition. The exact adjustment which is made by this function is also affected by the rotation of the block model definition.