Geometry service cannot be initialized

Suneel
Suneel Member Posts: 8
First Comment

Hi,
I am trying to reproduce the results as provided in PyAnsys Geometry 101: Modeling (https://geometry.docs.pyansys.com/version/stable/examples/01_getting_started/04_modeling.html). When I execute the first line, I am getting following error.

Tagged:

Best Answers

  • RobPasMue
    RobPasMue Member, Employee Posts: 10
    First Comment First Answer Name Dropper First Anniversary
    edited March 19 Answer ✓

    Hi @Suneel - you are completely right. We identified this issue some weeks ago and it has been resolved (for future releases). See: https://github.com/ansys/pyansys-geometry/commit/7d47fda9a73bb696d72bd1a0cd4ccab33399e7f6

    We are planning on doing a new release soon that will get your problem fixed! Stay tuned.

    In the meantime, please adapt your code as follows:

    modeler = launch_modeler("spaceclaim")
    

    OR

    modeler = launch_modeler(mode="spaceclaim")
    
  • RobPasMue
    RobPasMue Member, Employee Posts: 10
    First Comment First Answer Name Dropper First Anniversary
    Answer ✓

    FYI - you can also run SpaceClaim in hidden mode by running

    modeler = launch_modeler(mode="spaceclaim", hidden=True)
    

    That way you can run SpaceClaim in headless mode and completely delegate the visualization to PyVista (in case you are interested)

Answers

  • RobPasMue
    RobPasMue Member, Employee Posts: 10
    First Comment First Answer Name Dropper First Anniversary

    Hi @Suneel!

    Quick question, do you have any of the Ansys CAD products installed? That would be:

    • Ansys Discovery
    • Ansys SpaceClaim
    • Ansys Geometry Service

    Also, could you let me know what version of PyAnsys Geometry are you using?
    You can easily get this value by running the following:

    pip show ansys-geometry-core

  • Suneel
    Suneel Member Posts: 8
    First Comment

    Hi RobPasMue,
    Yes, I have Ansys CAD product installed. I am using Ansys 2024 R1, contains spaceClaim.

    The version of PyAnsys Geometry is 0.4.11

    Regards,
    Suneel

  • Suneel
    Suneel Member Posts: 8
    First Comment
    edited March 19

    Thank you for quick reply. It is opening the spaceClaim in standalone mode and building the geometry as per command. It is not showing anything wrt sketch command but subsequent commands it is updating in spaceClaim as well as PyVista.

  • RobPasMue
    RobPasMue Member, Employee Posts: 10
    First Comment First Answer Name Dropper First Anniversary

    Hi @Suneel - great that you got it working!

    The PyAnsys Geometry sketching API is purely client side. Meaning that it will not reflect anything on SpaceClaim. So that behavior is intended.

  • Suneel
    Suneel Member Posts: 8
    First Comment

    Ok Got it, Thanks for resolving my doubt. It solved my present problem. :p