Hi,
I have a question regarding Python Results in Mechanical. I am automatically generating Python results using a lot of code, structured as follows:
def createPicture(current_path):
import toolbar
toolbar.DoUndeformedWireFrameResultView(ExtAPI)
Graphics.ViewOptions.ResultPreference.ExtraModelDisplay =
MechanicalEnums.Graphics.ExtraModelDisplay.UndeformedWireframe
scfOut = ExtAPI.DataModel.GetObjectsByName('Outside SCF overview')[0]
imgPath = current_path + "\Results\SCFResOut.png"
cam = Graphics.Camera
cam.FocalPoint = Point([0, 7.5, 0], 'm')
cam.ViewVector = Vector3D(1, 0, 0)
cam.UpVector = Vector3D(0, 1, 0)
cam.SceneHeight = Quantity(15, 'm')
cam.SceneWidth = Quantity(botRad, 'm')
img = scfOut.AddImage()
img.SourceType = 1
img.ImagePath = imgPath
ExtAPI.Graphics.ExportScreenToImage(imgPath )
def post_started(sender, analysis): # Do not edit this line
define_dpf_workflow(analysis)
# Here comes my code, which is executed and performs some conversions, etc.
createPicture(path)
Now, the script should wait until the results are loaded and evaluated. Once they are created, the script should take a picture and save it. However, I can't find a function that waits and only creates the images after the evaluation is complete.
The issue is that if I let the script create the images while the evaluation is still in progress, it only produces a picture of the geometry without the results.