ansys / pymapdl

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

opening gui #81

Closed mahes2312 closed 4 years ago

mahes2312 commented 5 years ago

The below error i am getting while sing open_gui().any idea why it is.

Traceback (most recent call last): File "D:\Program_files\lib\site-packages\pyansys\ansys.py", line 1047, in open_corba self.mapdl.getComponentName() File "D:\Program_files\lib\site-packages\ansys_corba\ICoMapdlUnit_idl.py", line 185, in getComponentName return self._obj.invoke("getComponentName", _0_AAS_CORBA.MAPDL.Solvers.ICoMapdlUnit._d_getComponentName, args) omniORB.CORBA.COMM_FAILURE: CORBA.COMM_FAILURE(omniORB.COMM_FAILURE_WaitingForReply, CORBA.COMPLETED_MAYBE)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Mahes\open_gui\Open_Gui\Open\Gui.py", line 23, in ansys.open_gui() File "D:\Program_files\lib\site-packages\pyansys\ansys.py", line 1138, in open_gui self._open() File "D:\Program_files\lib\site-packages\pyansys\ansys.py", line 467, in _open self.open_corba(self.nproc, self.start_timeout, additional_switches) File "D:\Program_files\lib\site-packages\pyansys\ansys.py", line 1049, in open_corba raise Exception('Unable to connect to APDL server') Exception: Unable to connect to APDL server

akaszynski commented 5 years ago

Sorry, not sure what's causing this. What's your ANSYS version and OS?

spectereye commented 5 years ago

similar error met when open_gui, windows 10 x64, ansys 18.1

2019-06-19 21:50:44,076 [INFO] pyansys.ansys: ***** ROUTINE COMPLETED *****  CP =         0.406
2019-06-19 21:50:44,091 [INFO] pyansys.ansys: ALL CURRENT ANSYS DATA WRITTEN TO FILE NAME= C:\Users\hasee\AppData\Local\Temp\ansys\tmp.db
  FOR POSSIBLE RESUME FROM THIS POINT
2019-06-19 21:50:44,105 [INFO] pyansys.ansys: ANSYS exited
The filename, directory name, or volume label syntax is incorrect.
2019-06-19 21:50:44,134 [INFO] pyansys.ansys: Connecting to ANSYS via CORBA
Traceback (most recent call last):
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 1066, in open_corba
    self.mapdl.getComponentName()
  File "C:\Python\lib\site-packages\ansys_corba\ICoMapdlUnit_idl.py", line 185, in getComponentName
    return self._obj.invoke("getComponentName", _0_AAS_CORBA.MAPDL.Solvers.ICoMapdlUnit._d_getComponentName, args)
omniORB.CORBA.COMM_FAILURE: CORBA.COMM_FAILURE(omniORB.COMM_FAILURE_WaitingForReply, CORBA.COMPLETED_MAYBE)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 25, in <module>
    ansys.open_gui()
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 1160, in open_gui
    self._open()
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 476, in _open
    self.open_corba(self.nproc, self.start_timeout, additional_switches)
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 1068, in open_corba
    raise Exception('Unable to connect to APDL server')
Exception: Unable to connect to APDL server
Exception ignored in: <bound method ANSYS.__del__ of <pyansys.ansys.ANSYS object at 0x0000023FCD2F1630>>
Traceback (most recent call last):
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 944, in __del__
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 966, in Exit
Exception: CORBA.TRANSIENT(omniORB.TRANSIENT_ConnectFailed, CORBA.COMPLETED_NO)
akaszynski commented 5 years ago

I've just updated open_gui in the latest release pyansys==0.37.2. Could you please see if that release fixes the bug?

spectereye commented 5 years ago

@akaszynski Greeeat and thanks for your quick response! tested with latest pyansys 0.37.2, it open the gui successfully ! but after i exit the gui from "file - exit" i got another error below

+------------------ E N D   A N S Y S   S T A T I S T I C S -------------------+

 *---------------------------------------------------------------------------*
 |                                                                           |
 |                            ANSYS RUN COMPLETED                            |
 |                                                                           |
 |---------------------------------------------------------------------------|
 |                                                                           |
 | Ansys Release 18.1          Build 18.1         UP20170403     WINDOWS x64 |
 |                                                                           |
 |---------------------------------------------------------------------------|
 |                                                                           |
 | Database Requested(-db)  1024 MB    Scratch Memory Requested      1024 MB |
 | Maximum Database Used       1 MB    Maximum Scratch Memory Used      5 MB |
 |                                                                           |
 |---------------------------------------------------------------------------|
 |                                                                           |
 |        CP Time      (sec) =          2.703       Time  =  10:49:39        |
 |        Elapsed Time (sec) =         58.000       Date  =  06/20/2019      |
 |                                                                           |
 *---------------------------------------------------------------------------*
2019-06-20 10:49:40,177 [INFO] pyansys.ansys: Connecting to ANSYS via CORBA
Traceback (most recent call last):
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 1066, in open_corba
    self.mapdl.getComponentName()
  File "C:\Python\lib\site-packages\ansys_corba\ICoMapdlUnit_idl.py", line 185, in getComponentName
    return self._obj.invoke("getComponentName", _0_AAS_CORBA.MAPDL.Solvers.ICoMapdlUnit._d_getComponentName, args)
omniORB.CORBA.COMM_FAILURE: CORBA.COMM_FAILURE(omniORB.COMM_FAILURE_WaitingForReply, CORBA.COMPLETED_MAYBE)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Felix/working/Python/test_pyansys/main.py", line 24, in <module>
    ansys.open_gui()
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 1171, in open_gui
    self._open()
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 476, in _open
    self.open_corba(self.nproc, self.start_timeout, additional_switches)
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 1068, in open_corba
    raise Exception('Unable to connect to APDL server')
Exception: Unable to connect to APDL server
Exception ignored in: <bound method ANSYS.__del__ of <pyansys.ansys.ANSYS object at 0x000001CEBDF1FE10>>
Traceback (most recent call last):
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 944, in __del__
  File "C:\Python\lib\site-packages\pyansys\ansys.py", line 966, in Exit
Exception: CORBA.TRANSIENT(omniORB.TRANSIENT_ConnectFailed, CORBA.COMPLETED_NO)

Process finished with exit code 1

and my simple codes:

import os
import pyansys

cwd = os.getcwd()
ansys = pyansys.ANSYS(run_location=cwd, interactive_plotting=True, override=True)

ansys.Prep7()
ansys.K(1, 0, 0, 0)
ansys.K(2, 1, 0, 0)
ansys.K(3, 1, 1, 0)
ansys.K(4, 0, 1, 0)
ansys.L(1, 2)
ansys.L(2, 3)
ansys.L(3, 4)
ansys.L(4, 1)
ansys.Al(1, 2, 3, 4)

# ansys.View(1, 1, 1, 1)
# ansys.Pnum('kp', 1)
# ansys.Pnum('line', 1)

ansys.open_gui()

ansys.Et(1, 'MESH200', 6)
ansys.Amesh('all')
ansys.Eplot()

ansys.Aplot()
ansys.Lplot()
ansys.Kplot()

# ansys.Save()
# ansys.Exit()
akaszynski commented 4 years ago

Does this issue still occur with the latest pyansys?

akaszynski commented 4 years ago

Once pyansys=0.39.11 is out, could you please check if this issue stills occur.

Closing soon due to inactivity.

bridge-ding commented 4 years ago

i cannot use the function Mapdl or mapdl

bridge-ding commented 4 years ago

and i wamt to know how to connect the pyansys with the apdl of ansys, because the error like there is no mudle of mapdl or Mapdl often occurs

akaszynski commented 4 years ago

Hello,

I've updated the API to use pyansys.launch_mapdl() instead of the older pyansys.Mapdl(). Please see the updated docs at: https://akaszynski.github.io/pyansys/

bridge-ding commented 4 years ago

hello, there are some problems existed as above.  I want your help to tell me how to connect the APDL of ANSYS with a video or word. THanks

------------------ Original ------------------ From: "akaszynski/pyansys" <notifications@github.com>; Date: Mon, Sep 28, 2020 03:29 AM To: "akaszynski/pyansys"<pyansys@noreply.github.com>; Cc: "丁关"<1819924199@qq.com>;"Comment"<comment@noreply.github.com>; Subject: Re: [akaszynski/pyansys] opening gui (#81)

Hello,

I've updated the API to use pyansys.launch_mapdl() instead of the older pyansys.Mapdl(). Please see the updated docs at: https://akaszynski.github.io/pyansys/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

bridge-ding commented 4 years ago

Please give me hands to use the Pyansys in right ways

------------------ Original ------------------ From: "akaszynski/pyansys" <notifications@github.com>; Date: Mon, Sep 28, 2020 03:29 AM To: "akaszynski/pyansys"<pyansys@noreply.github.com>; Cc: "丁关"<1819924199@qq.com>;"Comment"<comment@noreply.github.com>; Subject: Re: [akaszynski/pyansys] opening gui (#81)

Closed #81.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

akaszynski commented 4 years ago

@bridge-ding, Here's the documentation for starting MAPDL via pyansys: https://akaszynski.github.io/pyansys/mapdl/index.html#pyansys-mapdl-basics

Please open a new issue with code you've tried so we can narrow down what's causing the problem.