Using Mechanical Scripting, how can I export images of results?

Options
Landon Mitchell Kanner
Landon Mitchell Kanner Member, Employee Posts: 208
First Answer First Comment 5 Likes First Anniversary
edited June 2023 in Structures

Comments

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 208
    First Answer First Comment 5 Likes First Anniversary
    Options
    for analysis in ExtAPI.DataModel.AnalysisList:
        analysisName = analysis.Name
        solution = analysis.Solution
        for child in solution.Children:
            childName = child.Name +"_"+ analysisName
            child.Activate()
            imagePath = "D:/{}.png".format(childName) 
            ExtAPI.Graphics.ExportImage(imagePath)
    


  • prasadmsonar_123
    prasadmsonar_123 Member Posts: 2
    Name Dropper First Comment
    Options

    Hello @Landon Mitchell Kanner , Thanks for sharing this.
    How to save these results in working directory?
    Lets say we have defined working directory as dirName = ExtAPI.DataModel.Project.Model.Analyses[0].WorkingDir