Description This function retrieves the collected data statistics for a specific data type from a Data Collector Surface.
Syntax success = DataCollectorSurfGetDataStats( surf, dataType, tStats )
Parameters success (boolean) Return value indicating whether data collector statistics were successfully retrieved for the desired data type.
surf As Long Node number of the data collector surface being queried for collected data statistics.
dataType As String This argument indicates the data type whose collected data statistics are being retrieved. Options are: Facet Area Incident Power Absorbed Power Incident Ray Count Absorbed Ray Count Irradiance Absorbed Irradiance Incident Ray Density Absorbed Ray Density Incident Facet Area Absorbed Facet Area
tStats As T_COLLECTED_DATA_STATS Passed in as an argument, this variable will be populated with the calculated statistics after the function executes.
Example The example below demonstrates how to identify active and initialized data collector surfaces in the model and report to the output window the collected data statistics of each collector to the output window.
Sub Main
Dim tStats As T_COLLECTED_DATA_STATS Dim dataType As String dataType = "Irradiance" Print "" Print "Data type stats being queried: " & dataType Print "NodeID" & Chr(9) & "Avg" & Chr(9) & "Count" & Chr(9) & "min" & Chr(9) & "max" & Chr(9) & "StdDev" & Chr(9) & "Total" & Chr(9) & "Full Name"
Dim curNode As Long, success As Boolean For curNode = 5 To GetEntityCount()-1 'Is the current entity a surface? If IsSurface( curNode ) Then 'Is the current surface a data collector? If IsDataCollectorSurf( curNode ) Then 'Is the data collector set to collect data? If DataCollectorSurfIsCollectData( curNode ) Then 'Is the data collector initialized? Doesn't guarantee non-zero data has been collected. If DataCollectorSurfIsDataAvailable( curNode ) Then
success = DataCollectorSurfGetDataStats( curNode, dataType, tStats ) Print curNode; Print tStats.avg; Print tStats.count; Print tStats.min; Print tStats.max; Print tStats.stdev; Print tStats.total; Print GetFullName( curNode )
End If End If End If End If Next
End Sub
See Also Data Collector Surface Scripting DataCollectorSurfGetDatumCount DataCollectorSurfIsCollectData DataCollectorSurfIsDataAvailable DataCollectorSurfReadCollectedDataFile DataCollectorSurfSetCollectData DataCollectorSurfWriteCollectedDataFile
|