mapteksdk.data.containers module

A Container is an object that can hold other objects. It is used to organise data in a hierarchical structure.

A container may have children objects, each of which has a name.

class mapteksdk.data.containers.Container(object_id=None, lock_type=<LockType.READ: 1>)

Bases: mapteksdk.data.base.DataObject

Plain container object that nests other objects.

It is used to organise data in a hierarchical structure. It is similar to a directory or folder concept in file systems. This type of container can not be viewed. If you are looking to create a container then you likely want to create a VisualContainer.

Parameters
  • object_id (ObjectID) – The ID of the object to open. If None make a new container.

  • lock_type (LockType) – The type of lock to place on the object. Default is Read.

classmethod static_type()

Return the type of container as stored in a Project.

This can be used for determining if the type of an object is a container.

save()

Saves the object to the dataengine.

class mapteksdk.data.containers.VisualContainer(object_id=None, lock_type=<LockType.READ: 1>)

Bases: mapteksdk.data.containers.Container

A container whose content is intended to be spatial in nature and can be viewed.

This is the typical container object that users create and see in the explorer.

The container can be added to a view. Any applicable children in the container will also appear in the view.

classmethod static_type()

Return the type of visual container as stored in a Project.

This can be used for determining if the type of an object is a visual container.

save()

Saves the object to the dataengine.

class mapteksdk.data.containers.StandardContainer(object_id=None, lock_type=<LockType.READ: 1>)

Bases: mapteksdk.data.containers.VisualContainer

Class for standard containers (such as cad and surfaces).

classmethod static_type()

Return the type of standard container as stored in a Project.

class mapteksdk.data.containers.ChildView(children)

Bases: object

Provides a view onto the children of a container.

Iterating over the view will provide both the name and the ID of the objects like the items() function. The container object does not need to remain open to access data in this view. It has cached the data itself. Use Project.get_children() to get a view of the children of a container.

Parameters

children (list) – List of children to be viewed in the form name, ID.

names()

Returns the names of the children.

Returns

List of names of children.

Return type

list

ids()

Returns the object IDs of the children.

Returns

List of ObjectIDs of the children.

Return type

list

items()

Return the (name, object ID) pair for each child.

Returns

List of tuples in the form (name, object ID).

Return type

list