ansys / pymapdl

Pythonic interface to MAPDL
https://mapdl.docs.pyansys.com
MIT License
423 stars 120 forks source link

how to start ?? #703

Closed tziolek closed 2 years ago

tziolek commented 2 years ago

Hello Guys,

I just discovered this whole PYmapdl and think it is really great but cannot get my head around it...

I have Ansys 2021R2 installed and was just starting with Python scripting there.

Now I have installed ansys-api-mapdl-v0 0.4.1 somehow via cmd command; have Python 3.9 installed and got the Visual Studio Code but I'm really getting lost here ... not exactly sure about the functionalities

is there anybody that could help me out here to set it up so that it works? I'm not really a programmer, more structural engineer that would like to learn :) perhaps somebody willing to have some session online ?

Thanks Tomasz

natter1 commented 2 years ago

ansys-api-mapdl-v0 0.4.1

I think thats not the one you want. You should have a look at Getting Started. What you need is most likly: pip install ansys-mapdl-core

germa89 commented 2 years ago

I think thats not the one you want. You should have a look at Getting Started. What you need is most likly: pip install ansys-mapdl-core

Exactly. More or less the steps are:

  1. Install Ansys
  2. Install Python
  3. Install ansys-mapdl-core
  4. Create a python file and write something like:
    from ansys.mapdl.core import launch_mapdl
    mapdl = launch_mapdl()
    print(mapdl)

    This will launch a mapdl session and connect to it. Then you can write more commands to things. You can have a look at the examples:

These are part of the dev.madpldocs.pyansys.com which is the development documentation, which means it is not perfect but it will give you a taste. We are working on improving them more and more.

tziolek commented 2 years ago

Thanks guys - followed the steps looks something is not working; is this only valid for Mechanical Enterprise ? I have Ansys Mechancial Pro license

image

germa89 commented 2 years ago

There are two possible solutions to this:

I hope it helps!

tziolek commented 2 years ago

Hi Germa

thanks for additional lines but still same issue

I did add in python license_type='pro' license_type='mech_1' additional_switches="-p mech_1"

before executing each time

from ansys.mapdl.core import launch_mapdl mapdl = launch_mapdl()

Still problem

I have an Ansys license dedicated to my PC; its not a floating license - is that something relevant?

anything else I can try ?

germa89 commented 2 years ago

I think you are half way there. Try:

from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl(license_type='mech_1')

or

from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl(additional_switches="-p mech_1")
tziolek commented 2 years ago

YES!!!! now its working but I have no clue what to do next actually :)

super thanks - its quite some crazy stuff you guys are doing; hope to learn a lot coming days

germa89 commented 2 years ago

I'm happy it works for you!

To start, you can have a look to the example library: https://mapdldocs.pyansys.com/examples/index.html

I'm closing the issue then.

tziolek commented 2 years ago

many thanks