;导入itasca库并设置reset为offimport itasca as itit.command("python-reset-state off")
;建立演示用模型it.command(""" model new zone create brick size 6 6 6""";s为一个list,在其中输入想要出图的项目s = ['disp-x','disp-y','stress-max','stress-min'];range(i),i就是s中的项目个数for i in range(4): it.command(""" ;清空当前视口中的显示内容,左侧图例将会堆叠显示影响观感 plot clear ;在视口内创建显示项目,如果想显示label中的项目,如塑性区,则需要将contour替换为label plot item create zone active on contour {0} method average ;导出图片为svg格式,文件名即为s中的项目名称,导出文件应该与项目文件或者此.py文件在同一目录下,请自行测试 plot export svg filename \'{0}\' """.format(s[i]))