Client#

class ansys.mechanical.core.embedding.rpc.client.Client(host: str, port: int, timeout: float = 120.0)#

Client for connecting to Mechanical services.

Overview#

close

Close the connection.

upload

Upload a file to the server.

download

Download a file from the server.

download_project

Download all project files in the working directory of the Mechanical instance.

exit

Shuts down the Mechanical instance.

is_alive

Check if the Mechanical instance is alive.

__getattr__

Get attribute from the root object.

Import detail#

from ansys.mechanical.core.embedding.rpc.client import Client

Property detail#

property Client.is_alive#

Check if the Mechanical instance is alive.

Attribute detail#

Client.host#
Client.port#
Client.timeout#
Client.connection = None#
Client.root = None#

Method detail#

Client.__getattr__(attr)#

Get attribute from the root object.

Client.close()#

Close the connection.

Client.upload(file_name, file_location_destination=None, chunk_size=DEFAULT_CHUNK_SIZE, progress_bar=False)#

Upload a file to the server.

Client.download(files, target_dir=None, chunk_size=DEFAULT_CHUNK_SIZE, progress_bar=None, recursive=False)#

Download a file from the server.

Client.download_project(extensions=None, target_dir=None, progress_bar=False)#

Download all project files in the working directory of the Mechanical instance.

Client.exit()#

Shuts down the Mechanical instance.