Model

class Model
property id

The id of the model.

Type

str, read-only

property name

The name of the model.

Type

str

Raises

ReadOnlyError -- If Database is in read only mode.

property lighting_mode

The current lighting mode.

Type

LightingMode

Raises

ReadOnlyError -- If Database is in read only mode.

property active_geometry_layer

The current active geometry layer.

Type

GeometryLayer

Raises

ReadOnlyError -- If Database is in read only mode.

property active_position_layer

The current active position layer.

Type

PositionLayer

Raises

ReadOnlyError -- If Database is in read only mode.

property selected_surfaces

The surfaces currently selected.

Type

list(Surface)

Raises

ReadOnlyError -- If Database is in read only mode.

property leader_surface

The selection leader surface.

Type

Surface or None

Raises

ReadOnlyError -- If Database is in read only mode.

property selected_scene_objects

The scene objects currently selected.

Type

list(SceneObject)

Raises

ReadOnlyError -- If Database is in read only mode.

property leader_scene_object

The selection leader scene object.

Type

SceneObject or None

Raises

ReadOnlyError -- If Database is in read only mode.

find_lighting_layer(id)

Find a lighting layer by id.

Parameters

id (str) -- Layer id to find.

Returns

The lighting layer found or None if not found.

Return type

LightingLayer or None

Raises

InvalidIdFormat -- If id is not in GUID format.

list_lighting_layers()

List the lighting layers of the model.

Returns

The list of lighting layers of the model.

Return type

list(LightingLayer)

create_lighting_layer(name)

Create a new lighting layer in this model.

Parameters

name (str) -- Name of the layer.

Returns

The newly created layer.

Return type

LightingLayer

Raises

ReadOnlyError -- If Database is in read only mode.

find_geometry_layer(id)

Find a geometry layer by id.

Parameters

id (str) -- Layer id to find.

Returns

The geometry layer found or None if not found.

Return type

GeometryLayer or None

Raises

InvalidIdFormat -- If id is not in GUID format.

list_geometry_layers(recursive=True)

List the geometry layers of the model.

Parameters

recursive (bool) -- If True, list all layers in the model, otherwise only the root layers are returned.

Returns

The list of geometry layers of the model.

Return type

list(GeometryLayer)

create_geometry_layer(name)

Create a new geometry layer in this model.

Parameters

name (str) -- Name of the layer.

Returns

The newly created layer.

Return type

GeometryLayer

Raises

ReadOnlyError -- If Database is in read only mode.

find_bezier_path(id)

Find a bezier path by id.

Parameters

id (str) -- Bezier path id to find.

Returns

The bezier path found or None if not found.

Return type

BezierPath or None

Raises

InvalidIdFormat -- If id is not in GUID format.

list_bezier_paths()

List the bezier paths of the model.

Returns

The list of bezier paths of the model.

Return type

list(BezierPath)

create_bezier_path(name, positions, tangents, closed=True)

Create a new bezier path in this model.

Parameters
  • name (str) -- Name of the bezier path.

  • positions (list(Vector3)) -- Positions of the bezier path points. Must at least contain two element.

  • tangents (list(Vector3)) -- Tangents (left and right) of the bezier path points, in absoute positions. Must have twice the count of positions.

  • closed (bool) -- If the bezier path must be closed or not.

Returns

The newly created bezier path.

Return type

BezierPath

Raises
find_position_layer(id)

Find a position layer by id.

Parameters

id (str) -- Layer id to find.

Returns

The position layer found or None if not found.

Return type

PositionLayer or None

Raises

InvalidIdFormat -- If id is not in GUID format.

list_position_layers()

List the position layers of the model.

Returns

The list of position layers of the model in the right order.

Return type

list(PositionLayer)

create_position_layer(name)

Create a new position layer in this model

Note

The created layer will be activated.

Parameters

name (str) -- Name of the layer.

Returns

The newly created layer.

Return type

PositionLayer

Raises

ReadOnlyError -- If Database is in read only mode.

merge_position_layers(layer_list)

Merge the list of position layers.

Parameters

layer_list (list(PositionLayer)) -- The list of layers to merge.

Returns

The merged layer.

Return type

PositionLayer

Raises

ReadOnlyError -- If Database is in read only mode.

find_scene_object(id)

Find a scene object by id.

Parameters

id (str) -- Scene object id to find.

Returns

The scene object found or None if not found.

Return type

SceneObject or None

Raises

InvalidIdFormat -- If id is not in GUID format.

list_kinematic_objects(recursive=True)

List the kinematics objects of the model.

Parameters

recursive (bool) -- If True, list all kinematics objects in the model, otherwise only the root kinematics objects are returned.

Returns

The list of kinematics objects of the model.

Return type

list(SceneObject)

create_axis(name)

Create an Axis in this model.

Note

The created object will be selected, and the previous selection will be lost.

Parameters

name (str) -- Name of the axis.

Returns

The created axis.

Return type

Axis

Raises

ReadOnlyError -- If Database is in read only mode.

create_vector(name)

Create a Vector in this model.

Note

The created object will be selected, and the previous selection will be lost.

Parameters

name (str) -- Name of the vector.

Returns

The created vector.

Return type

Vector

Raises

ReadOnlyError -- If Database is in read only mode.

create_null(name)

Create a Null in this model.

Note

The created object will be selected, and the previous selection will be lost.

Parameters

name (str) -- Name of the null.

Returns

The created null.

Return type

Null

Raises

ReadOnlyError -- If Database is in read only mode.

find_product(id)

Find a product by id.

Parameters

id (str) -- Product id to find.

Returns

The product found or None if not found.

Return type

Product or None

Raises

InvalidIdFormat -- If id is not in GUID format.

list_products()

List the products of the model.

Returns

The list of products of the model.

Return type

list(Product)

create_product(name)

Create a new product in this model.

Parameters

name (str) -- Name of the product.

Returns

The newly created product.

Return type

Product

Raises

ReadOnlyError -- If Database is in read only mode.

list_configuration_parameters()

List all the ConfigurationParameter.

Returns

The list of ConfigurationParameter in this product.

Return type

list(ConfigurationParameter)

list_configuration_presets()

List all the ConfigurationPreset.

Returns

The list of Configuration in this product.

Return type

list(ConfigurationPreset)

create_configuration_preset(name)

Create a new ConfigurationPreset in this product.

Parameters

name (str) -- Name of the ConfigurationPreset.

Returns

The newly created ConfigurationPreset.

Return type

ConfigurationPreset

Raises

ReadOnlyError -- If Database is in read only mode.

list_tags()

List all the tags as string.

Returns

The list of tags in this model.

Return type

list(str)

list_tags_for_scene_objects(objects)

List all the tags assigned to scene objects.

Parameters

objects (list(SceneObject)) -- List of scene objects to get tags from.

Returns

The list of tags assigned to the scene objects.

Return type

list(str)

add_tag_to_scene_objects(tag, objects)

Create a new tag and assign to scene objects.

Parameters
Returns

Whether the tag was added or not.

Return type

bool

Raises

ReadOnlyError -- If Database is in read only mode.

remove_tag_from_scene_objects(tag, objects)

Remove tag from scene objects.

Parameters
Raises

ReadOnlyError -- If Database is in read only mode.