STKDesktop#

class ansys.stk.core.stkdesktop.STKDesktop#

object

Create, initialize, and manage STK Desktop application instances.

Overview#

start_application

Create a new STK Desktop application instance.

Specify visible = True to show the application window. Specify user_control = True to return the application to the user’s control. (the application remains open) after terminating the Python API connection. Specify grpc_server = True to attach to STK Desktop Application running the gRPC server at grpc_host:grpc_port. grpc_host is the IP address or DNS name of the gRPC server. grpc_port is the integral port number that the gRPC server is using (valid values are integers from 0 to 65535). grpc_timeout_sec specifies the time allocated to wait for a grpc connection (seconds). grpc_max_message_size is the maximum size in bytes that the gRPC client can receive. Set to zero to use the gRPC default. Only available on Windows.

attach_to_application

Attach to an existing STK Desktop instance.

Specify the Process ID (PID) in case multiple processes are open. Specify grpc_server = True to attach to STK Desktop Application running the gRPC server at grpc_host:grpc_port. grpc_host is the IP address or DNS name of the gRPC server. grpc_port is the integral port number that the gRPC server is using. grpc_timeout_sec specifies the time allocated to wait for a grpc connection (seconds). grpc_max_message_size is the maximum size in bytes that the gRPC client can receive. Set to zero to use the gRPC default. Only available on Windows.

release_all

Release all handles from Python to STK Desktop applications.

Not applicable to gRPC connections.

create_thread_marshaller

Return a ThreadMarshaller instance capable of marshalling the stk_object argument to a new thread.

Not applicable to gRPC connections.

Import detail#

from ansys.stk.core.stkdesktop import STKDesktop

Method detail#

STKDesktop.start_application(visible: bool = False, user_control: bool = False, grpc_server: bool = False, grpc_host: str = localhost, grpc_port: int = 40704, grpc_timeout_sec: int = 60, grpc_max_message_size: int = 0) STKDesktopApplication#

Create a new STK Desktop application instance.

Specify visible = True to show the application window. Specify user_control = True to return the application to the user’s control. (the application remains open) after terminating the Python API connection. Specify grpc_server = True to attach to STK Desktop Application running the gRPC server at grpc_host:grpc_port. grpc_host is the IP address or DNS name of the gRPC server. grpc_port is the integral port number that the gRPC server is using (valid values are integers from 0 to 65535). grpc_timeout_sec specifies the time allocated to wait for a grpc connection (seconds). grpc_max_message_size is the maximum size in bytes that the gRPC client can receive. Set to zero to use the gRPC default. Only available on Windows.

Parameters:

visible : bool

user_control : bool

grpc_server : bool

grpc_host : str

grpc_port : int

grpc_timeout_sec : int

grpc_max_message_size : int

Returns:

STKDesktopApplication

STKDesktop.attach_to_application(pid: int = None, grpc_server: bool = False, grpc_host: str = localhost, grpc_port: int = 40704, grpc_timeout_sec: int = 60, grpc_max_message_size: int = 0) STKDesktopApplication#

Attach to an existing STK Desktop instance.

Specify the Process ID (PID) in case multiple processes are open. Specify grpc_server = True to attach to STK Desktop Application running the gRPC server at grpc_host:grpc_port. grpc_host is the IP address or DNS name of the gRPC server. grpc_port is the integral port number that the gRPC server is using. grpc_timeout_sec specifies the time allocated to wait for a grpc connection (seconds). grpc_max_message_size is the maximum size in bytes that the gRPC client can receive. Set to zero to use the gRPC default. Only available on Windows.

Parameters:

pid : int

grpc_server : bool

grpc_host : str

grpc_port : int

grpc_timeout_sec : int

grpc_max_message_size : int

Returns:

STKDesktopApplication

STKDesktop.release_all() None#

Release all handles from Python to STK Desktop applications.

Not applicable to gRPC connections.

Returns:

None

STKDesktop.create_thread_marshaller(stk_object) ThreadMarshaller#

Return a ThreadMarshaller instance capable of marshalling the stk_object argument to a new thread.

Not applicable to gRPC connections.

Returns:

ThreadMarshaller