// Export PhotooEditor.FitAll()view="Dimetric","Trimetric","Front","Top","Right","Bottom"photo_name = oDesign.GetName()path ='D://AEDT_file'# 給定路徑 #for i in view: oEditor.ExportModelImageToFile("{}\{}_{}.jpg".format(path,photo_name,i), 2400, 1200, ["NAME:SaveImageParams","ShowAxis:=" , "False","ShowGrid:=" , "False","ShowRuler:=" , "True","ShowRegion:=" , "Default","Selections:=" , "","FieldPlotSelections:=" , "","FitToSelections:=" , "","FitToFieldPlotSelections:=", "","Orientation:=" , i ])AddWarningMessage("Export {}_{}.jpg to {}".format(photo_name,i,path))
匯出的3D模型圖,如圖3-20所示。
Export Field Report
類似匯出圖片的指令,我們能將場圖用指令匯出成JPG檔到資料夾中。
// Export Field Reportfieldplot=[]fieldplot=oModule1.GetMeshPlotNames()+oModule1.GetFieldPlotNames()for field in fieldplot:AddWarningMessage("Export: {}.jpg".format(field)) oModule1.ExportPlotImageToFile("{}\{}.jpg".format(path, field), "", "{}".format(field),"")
匯出的場圖,如圖3-21所示。
Export Report to CSV
利用ExportToFile的指令,能將Result中的資料匯出成CSV格式,如圖3-20所示。
// Export Report to CSVoModule = oDesign.GetModule("ReportSetup")oModule.ExportToFile("L with different gap", "D:/L with different gap.csv", False)