Get component name or material name from element number using python API

Hello:

The subject line pretty much says it all. Is there a way to obtain the component name or material name of an element from the element number using the python API? I see nothing about this in the API. I'm on version 13.1.

Rick.

Comments

  • Additionally: is there a way to return a list of element numbers from a given component name or material name? I also see nothing about this in the python API.

    Rick.
  • Another request: is there a way to get the path of the current mecway file? os.getcwd() just returns the path to the current python script.
  • Hello RICYTEACH

    The API is still limited to the types of operations listed in the manual but getting component names from element numbers and vice versa will be in the next version (14).

    There's an undocumented function for the path of the current file already available in version 13 : mw.file_name()
  • edited October 2020
    Great that's really really helpful on the filename(). You just saved me a couple hours of coding something together using a temporary environment variable to store the user entered location (so it can be referred to later across multiple modules) and then deleting it when Mecway is shutdown.

    FYI: what I am up to is writing a script for turning a 2D Mecway mesh into a CANDE mesh:

    https://www.candeforculverts.com/

    Unfortunately it has to be very complex currently because of the lack of ability to inspect the component and material names... looking forward to that version 14.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!