mapteksdk.data.io module

Functions for importing and exporting data.

import_00t(path, unit=DistanceUnit.metre)

Import a Maptek Vulcan Triangulation file (00t) into the project.

Parameters
  • path (str) – Path to file to import.

  • unit (DistanceUnit) – The unit used when exporting the file.

Returns

  • ObjectID – The ID of the imported object.

  • None – If there was an error importing the object.

Raises
  • FileNotFoundError – If the file does not exist.

  • TypeError – If the unit is not an instance of DistanceUnit.

  • RuntimeError – If there is a problem importing the file.

Notes

The imported object is not automatically placed inside a container. A call to project.add_object() is required to add it to a container.

export_00t(object_id, path, unit=DistanceUnit.metre)

Export the object referenced by the object ID to a Maptek Vulcan Triangulation file (00t).

Parameters
  • object_id (ObjectID) – The ID of the object to export to the 00t file.

  • path (str) – Where to save the exported 00t.

  • unit (DistanceUnit) – Unit to use when exporting the file.

Returns

True if successful otherwise False.

Return type

bool

Raises
  • TypeError – If the unit is not an instance of DistanceUnit.

  • RuntimeError – If there is a problem exporting the file.

import_bmf(path, unit=DistanceUnit.metre)

Import a Maptek Block Model File (bmf) into the project.

Parameters
  • path (str) – Path to file to import.

  • unit (DistanceUnit) – Unit to use when importing the file.

Returns

  • ObjectID – The ID of the imported object.

  • None – If there was an error importing the object.

Raises
  • TypeError – If the unit is not an instance of DistanceUnit.

  • FileNotFoundError – If the file does not exist.

  • RuntimeError – If there is a problem importing the file.

export_bmf(object_id, path, unit=DistanceUnit.metre)

Export a block model to a Maptek Block Model File (bmf).

Parameters
  • object_id (ObjectID) – The block model to export as a bmf file.

  • path (str) – Where to save the exported bmf file.

  • unit (DistanceUnit) – Unit to use when exporting the file.

Returns

True if successful otherwise False.

Return type

bool

Raises
  • TypeError – If the unit is not an instance of DistanceUnit.

  • RuntimeError – If there is a problem exporting the file.

import_maptekobj(path)

Import a Maptek Object file (maptekobj) into the project.

Parameters

path (str) – Path to file to import.

Returns

  • ObjectID – The ID of the imported object.

  • None – If there was an error importing the object.

Raises
  • FileNotFoundError – If the file does not exist.

  • RuntimeError – If there is a problem importing the file.

export_maptekobj(object_id, path)

Export an object to a Maptek Object file (maptekobj).

Parameters
  • object_id (ObjectID) – The ID of the object to export to a maptekobj file.

  • path (str) – Where to save the exported maptekobj file.

Returns

True if successful otherwise False.

Return type

bool

Raises

RuntimeError – If there is a problem exporting the file.