Exporting elements ID of contact region

Hello, I am trying to print element ids of the contact region but it gives an error that "CONTACT_01" (name of contact region is not defined., even though I have created a contact with this name and same is present in the .inp file. Below is the code I am using. Pls give suggestions if any.

from ansys.mapdl.core import launch_mapdl

mapdl = launch_mapdl()


mapdl.cmsel('S', 'CONTACT_01')

element_ids = mapdl.cmlist("ELEM")




  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 234
    First Anniversary First Comment 5 Likes Ansys Employee
    edited October 2023

    Can you confirm you can select the component if you simply issue the APDL commands as text like:



    Also, is the component a nodal or element component? Seems from context it should be elemental?

  • Shailesh Kumar
    Shailesh Kumar Member Posts: 10
    First Comment

    Hello, Thanks for your reply

    I tried using the above command but it still showing the same error.

    The exact error msg is -----------"Error in instance GRPC_127.0.0.1:50052


    *** ERROR *** CP = 0.859 TIME= 09:29:52
    Component CONTACT_01 is not defined."----------

    And the component is element component and I am trying to get element ids.