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
GeomAIGeometryobject and all its data from the server.- Parameters:
geometry (GeomAIGeometry | str) – ID or
modelof the geometry.- Raises:
NotFoundError – No geometry with the given ID exists.
- get(id: str | None = None, name: str | None = None) GeomAIGeometry#
Get a specific
GeomAIGeometryobject from the server.You can specify either the ID or the name, not both.
- Parameters:
- Returns:
- Raises:
NotFoundError – No geometry with the given ID or name exists.
- Return type:
- list() List[GeomAIGeometry]#
List all the
GeomAIGeometryobjects on the server.- Returns:
List of all the
GeomAIGeometryobjects on the server.- Return type:
- 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
vtpandstl.- Parameters:
- Returns:
Created
GeomAIGeometryobject.- Raises:
InvalidArguments – If the file extension is not supported.
- Return type:
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.
- 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
modelof the target workspace. Defaults to the current workspace if set.- Returns:
The
GeomAIProjectionof the geometry if it exists,Noneotherwise.- Return type:
GeomAIProjection | None
- 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
modelof the target workspace. Defaults to the current workspace if set.- Returns:
The
GeomAIProjectionof the geometry.- Return type:
- wait(timeout: float | None = None) bool#
Wait for all jobs concerning the object to either finish or fail.
- property failure_reason#
Optional message giving the causes for why the creation of the object failed.
See also
- property has_failed#
Boolean indicating if the creation of the object failed.
See also
- property is_pending#
Boolean indicating if the object is still in creation. The value becomes
Falseonce object creation is either successful or has failed.See also
- property is_ready#
Boolean indicating if the object has finished creating without error.
See also