Launch a remote session#

If a remote server is running Ansys 2023 R2 or later and is also running PIM (Product Instance Manager), you can use PIM to start a Discovery or SpaceClaim session that PyAnsys Geometry can connect to.

Warning

This option is only available for Ansys employees.

Only Ansys employees with credentials to the Artifact Repository Browser can download ZIP files for PIM.

Set up the client machine#

  1. To establish a connection to the existing session from your client machine, open Python and run these commands:

    from ansys.discovery.core import launch_modeler_with_pimlight_and_discovery
    
    disco = launch_modeler_with_pimlight_and_discovery("241")
    

    The preceding commands launch a Discovery (version 24.1) session with the API server. You receive a model object back from Discovery that you then use as a PyAnsys Geometry client.

  2. Start SpaceClaim or the Geometry service remotely using commands like these:

    from ansys.discovery.core import launch_modeler_with_pimlight_and_spaceclaim
    
    sc = launch_modeler_with_pimlight_and_spaceclaim("version")
    
    from ansys.discovery.core import launch_modeler_with_pimlight_and_geometry_service
    
    geo = launch_modeler_with_pimlight_and_geometry_service("version")
    

Note

Performing all these operations remotely eliminates the need to worry about the starting endpoint or managing the session.

End the session#

To end the session, run the corresponding command:

disco.close()
sc.close()
geo.close()

Go to Getting started