Closed 15076882301 closed 1 year ago
I am a novice, the first contact, thank you for your help, thank you very much
Hi @15076882301! Thanks for opening your first issue. It seems to me that this is an issue related to PyMAPDL specifically. Let me move your issue to the corresponding repository and ping one of their maintainers (@germa89).
Thanks for getting in touch!
My gut feeling is that the encoding of the file might not be the correct one or similar... But I'll leave it to the experts.
@RobPasMue Ok, thank you for your answer,
@germa89 Hi, elder brother, I need to ask you some questions. I want to obtain the parameters in the wbpj file and modify them. I don't know whether my release of use is correct, because I reported a mistake in this way.
Hi @15076882301 A wbpj is not an Mechanical APDL file, nor is it a file that MAPDL can read/input directly. It (wbpj) is an XML file - perhaps you could use the Python XML module to parse through the file to retrieve parameters then pass them to MAPDL.
Can I ask why you want to retrieve parameters from a wbpj file in PyMAPDL?
Mike
Hi @mikerife I am a student. In my graduation design, I plan to do a secondary development of ansys based on python, read the input parameters and modify them as a table on the interface, and then open the outgoing interface and default mode of the post-processing module. As a student majoring in computer science, I have not systematically learned the operation of ansys software, and my classmates have not come into contact with it. I plan to have a try
secondary development of ansys based on python
Hi @15076882301
As @mikerife pointed out, you can't read a wbpj
file with PyMAPDL. You could though read the ds.dat
file in the zipped project wbpz
. For that, you need to open your Workbench project and "archive" it (See https://www.youtube.com/watch?v=MtiA1PkO6ww). This will generate a wbpz
file which can be extracted as it were a zip. Inside it, you should find (in one of the folders, depends on your simulation type) a ds.dat
file which you can use.
By the way, what do you mean with "secondary development"?
Hi @germa89 In fact, using pyansys library, add a layer of graphical interface outside, I call it secondary development, ha ha ha
I guess a layer of graphical interface in Qt?
Well, anyway. There is no way to read wbpj
using any of the Ansys libraries for now. Closing the issue.
Hi @germa89 Yes, I want to make an interface with Qt. Thank you for answering my question.
🔍 Before submitting the issue
🐞 Description of the bug
I want to read the parameters in the wbpj file, using the following
from ansys.mapdl.core import launch_mapdl import pyansys
mapdl = launch_mapdl() mapdl.input("C:\Test\1.wbpj")
print(mapdl.parameters)
mapdl.exit()
When the code was executed to mapdl.input("C:\Test\1.wbpj"), the program crashed. I found that line mapdl_grpc.py 1423 of the temporarily generated file was read incorrectly. When I opened the read file, I found that it was full of error information
📝 Steps to reproduce
from ansys.mapdl.core import launch_mapdl import pyansys
mapdl = launch_mapdl() mapdl.input("C:\Test\1.wbpj")
print(mapdl.parameters)
mapdl.exit()
💻 Which operating system are you using?
Windows
📀 Which ANSYS version are you using?
Ansys 2021 R1
🐍 Which Python version are you using?
3.8
📦 Installed packages