Closed rokamoto26 closed 1 month ago
@rokamoto26 , GetResultsData()
creates a lock on results file unless Dispose()
is called. Please see modified code below
analysis = ExtAPI.DataModel.Project.Model.Analyses[_num]
meshObj = analysis.MeshData
elementids = meshObj.ElementIds
# Get nodes
# element = meshObj.ElementById(elementid)
reader = analysis.GetResultsData()
DataSets=reader.ListTimeFreq
print ("_num:",_num)
print ("DataSets:",list(DataSets))
print ("DataSets:",str(DataSets[0]))
reader.Dispose()
@dipinknair, Thank you for your help. I confirmed the issue was solved by applying the modification you proposed. Thanks again!
🔍 Before submitting the issue
🐞 Description of the bug
Only in Embedded instances, the analysis fails with the following error in Mechanical on the second static structural system when I used Model.AddStaticStructuralAnalysis() twice in one session. The same process works fine with Mechanical scripting and Remote sessions.
[Error] An unknown error occurred during solution. Check the Solver Output on the Solution Information object for possible causes.
📝 Steps to reproduce
Run PyMechanicalTest_EmbeddedInstance.py in the ZIP file attached. Scripts for Remote Session is also included in ZIP for reference. test_codes.zip
💻 Which operating system are you using?
Windows
📀 Which ANSYS version are you using?
2024R2
🐍 Which Python version are you using?
3.11
📦 Installed packages