Model
- class Model
-
- property name
The name of the model.
- Type
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- property lighting_mode
The current lighting mode.
- Type
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- property active_geometry_layer
The current active geometry layer.
- Type
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- property active_position_layer
The current active position layer.
- Type
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- property selected_surfaces
The surfaces currently selected.
- Type
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- property leader_surface
The selection leader surface.
- Type
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- property selected_scene_objects
The scene objects currently selected.
- Type
- 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.
- list_surfaces()
List the surfaces of the model.
- list_visible_surfaces()
List the visible surfaces of the model.
- 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
- 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
- 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
- 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
- Raises
InvalidIdFormat -- If
id
is not in GUID format.
- list_geometry_layers(recursive=True)
List the geometry layers of the model.
- 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
- 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
- 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
- Raises
ReadOnlyError -- If
Database
is in read only mode.ValueError -- If positions and tangents do not have the same length or have less than 2 elements.
- 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
- 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
- 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
- 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
- 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.
- 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
- 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
- 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
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- find_product(id)
Find a product by id.
- list_products()
List the products of the model.
- create_product(name)
Create a new product in this model.
- Parameters
name (str) -- Name of the product.
- Returns
The newly created product.
- Return type
- 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_configuration_presets()
List all the
ConfigurationPreset
.- Returns
The list of
Configuration
in this product.- Return type
- 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
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- list_tags()
List all the tags as string.
- 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
- add_tag_to_scene_objects(tag, objects)
Create a new tag and assign to scene objects.
- Parameters
tag (str) -- Name of the tag.
objects (list(SceneObject)) -- List of scene objects.
- Returns
Whether the tag was added or not.
- Return type
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- remove_tag_from_scene_objects(tag, objects)
Remove tag from scene objects.
- Parameters
tag (str) -- Name of the tag.
objects (list(SceneObject)) -- List of scene objects.
- Raises
ReadOnlyError -- If
Database
is in read only mode.
- find_saved_selection(id)
Find a saved selection by id.
- Parameters
id (str) -- Saved selection id to find.
- Returns
The saved selection found or
None
if not found.- Return type
- Raises
InvalidIdFormat -- If
id
is not in GUID format.
- list_saved_selections()
List the saved selections of the model.
- Returns
The list of saved selections of the model.
- Return type
- create_saved_selection(name)
Create a new empty saved selection in this model.
- Parameters
name (str) -- Name of the saved selection.
- Returns
The newly created saved selection.
- Return type
- Raises
ReadOnlyError -- If
Database
is in read only mode.