此範例會使用網格診斷中的縱橫比資料,建立自訂輪廓線出圖。指令碼會使用 DiagnosisManager 類別來存取網格診斷資料,並使用 PlotManager 類別來建立自訂使用者出圖。
'@ '@ DESCRIPTION '@ Take the Standard Aspect Ratio Plot and convert it into a contour plot '@ '@ SYNTAX '@ CustomAspect '@ '@ PARAMETERS '@ none '@ '@ DEPENDENCIES/LIMITATIONS '@ Assumes a study file is open within synergy '@ none '@ '@ History '@ Created DRA 9/8/2006 '@@ Option Explicit SetLocale("en-us") Dim Synergy Set Synergy = CreateObject("synergy.Synergy") Synergy.SetUnits "METRIC" Dim DiagnosisManager, PlotManager Dim Elems, AR, ARPlot ' Get aspect ratio diagnostics Set Elems = Synergy.CreateIntegerArray() Set AR = Synergy.CreateDoubleArray() Set DiagnosisManager = Synergy.DiagnosisManager() DiagnosisManager.GetAspectRatioDiagnosis 0.0, 0.0, True, Elems, AR Set DiagnosisManager = Nothing ' Create user plot Set PlotManager = Synergy.PlotManager() Set ARPlot = PlotManager.CreateUserPlot() ARPlot.SetDataType "ELDT" ARPlot.SetName "Aspect ratio by contours" ARPlot.AddScalarData 0.0, Elems, AR ARPlot.Build MsgBox "Script Complete" Wscript.Quit