connect_to_or_start_server#

ansys.dpf.composites.server_helpers.connect_to_or_start_server(port=None, ip=None, ansys_path=None, **kwargs)#

Connect to or start a DPF server with the DPF Composites plugin loaded.

Note

If a port or IP address is set, this method tries to connect to the server specified and the ansys_path parameter is ignored. If no parameters are set, a local server from the latest available Ansys installation is started.

Parameters:
  • port (Optional[int], default: None) – Port that the DPF server is listening on.

  • ip (Optional[str], default: None) – IP address for the DPF server.

  • ansys_path (Optional[str], default: None) – Root path for the Ansys installation. For example, C:\\Program Files\\ANSYS Inc\\v232. This parameter is ignored if either the port or IP address is set.

  • **kwargs (Any) – Additional keyword arguments are passed to either ansys.dpf.core.start_local_server or ansys.dpf.core.connect_to_server to set a timeout, config and context. For instance, the transport mode must be set via the config parameter in kwargs to connect to a running gRPC server. See https://dpf.docs.pyansys.com/version/stable/ for more information.

Return type:

Any

Returns:

DPF server.