GeomAIGeometries#

The Geometries module is in charge of uploading and managing the geometries.

Directory#

class GeomAIGeometryDirectory#

Provides a collection of methods related to GeomAI geometries.

This class is accessed through client.geomai.geometries.

Example

import ansys.simai.core as asc

simai_client = asc.from_config()
simai_client.geomai.geometries.list()
delete(geometry: GeomAIGeometry | str) → None#

Delete a GeomAIGeometry object and all its data from the server.

Parameters:

geometry (GeomAIGeometry | str) – ID or model of the geometry.

Raises:

NotFoundError – No geometry with the given ID exists.

get(id: str | None = None, name: str | None = None) → GeomAIGeometry#

Get a specific GeomAIGeometry object from the server.

You can specify either the ID or the name, not both.

Parameters:
  • id (str | None) – ID of the geometry.

  • name (str | None) – Name of the geometry.

Returns:

GeomAIGeometry

Raises:

NotFoundError – No geometry with the given ID or name exists.

Return type:

GeomAIGeometry

list() → List[GeomAIGeometry]#

List all the GeomAIGeometry objects on the server.

Returns:

List of all the GeomAIGeometry objects on the server.

Return type:

List[GeomAIGeometry]

upload(file: Path | str | PathLike | Tuple[BinaryIO | RawIOBase | BufferedIOBase | Path | str | PathLike, str], monitor_callback: Callable[[int], None] | None = None) → GeomAIGeometry#

Upload a geometry to the server.

The supported file formats are vtp and stl.

Parameters:
Returns:

Created GeomAIGeometry object.

Raises:

InvalidArguments – If the file extension is not supported.

Return type:

GeomAIGeometry

Example

import ansys.simai.core as asc

simai_client = asc.from_config()
geometry = simai_client.geomai.geometries.upload("my_geometry.vtp")
geometry.wait()

Model#

class GeomAIGeometry#

Provides the local representation of a GeomAI geometry object.

delete() → None#

Delete the geometry and all its data from the server.

get_projection(workspace: GeomAIWorkspace | str | None = None) → GeomAIProjection | None#

Get the existing projection of the geometry onto the model of the given workspace.

Parameters:

workspace (GeomAIWorkspace | str | None) – Optional ID or model of the target workspace. Defaults to the current workspace if set.

Returns:

The GeomAIProjection of the geometry if it exists, None otherwise.

Return type:

GeomAIProjection | None

reload() → None#

Refresh the object with its representation from the server.

rename(new_name: str) → None#

Rename the geometry.

Parameters:

new_name (str) – New name to give to the geometry.

run_projection(workspace: GeomAIWorkspace | str | None = None) → GeomAIProjection#

Project the geometry onto the model of the given workspace.

Parameters:

workspace (GeomAIWorkspace | str | None) – Optional ID or model of the target workspace. Defaults to the current workspace if set.

Returns:

The GeomAIProjection of the geometry.

Return type:

GeomAIProjection

wait(timeout: float | None = None) → bool#

Wait for all jobs concerning the object to either finish or fail.

Parameters:

timeout (float | None) – Maximum amount of time in seconds to wait. The default is None, it means that there is no maximum on the time to wait.

Returns:

True if the computation has finished, False if the operation timed out.

Return type:

bool

property failure_reason#

Optional message giving the causes for why the creation of the object failed.

See also

property fields: dict#

Dictionary containing the raw object representation.

property has_failed#

Boolean indicating if the creation of the object failed.

property id: str#

ID of the object on the server.

property is_pending#

Boolean indicating if the object is still in creation. The value becomes False once object creation is either successful or has failed.

property is_ready#

Boolean indicating if the object has finished creating without error.

property name: str#

Name of the geometry.