Hello,
I'm trying to use Pymechanical to run a DOE with different parameter sets,
below is my function to run the model, when I solve the model, the analysis.Solution.get_Status() is not "done", and I cannot get the result.
If I import the .mechdb into GUI, it shows the red flash, and an error message


But When I checked the .out it just looks fine, without any error.
I'm not sure what has happened.
def run_mechdb(app,Contact_length,Contact_offset,template_file,outupt_file):
from ansys.mechanical.core.embedding.global_importer import Quantity
app.new()
app.open(db_file=template_file) # open the template model, winch is a .mechdat file
app.save_as(outupt_file, overwrite=True) # save the .mechdb model to a new place
#I'm not sure how the "Save As" function works. Will the new one active after I "Save As"?
#So, I closed the file and open the new file in below lines
app.close() #close the template model
app.open(outupt_file)
model=app.Model
model.Geometry.UpdateGeometryFromSource() # update the model
analysis = model.Analyses[0]
#app.print_tree()
analysis.Solution.Solve()
print(str(analysis.Solution.get_Status()))
if str(analysis.Solution.get_Status()) != "Done":
analysis.Solution.Solve()
print("Solve Again",str(analysis.Solution.get_Status()))
app.save(outupt_file)
app.close()
return