Description This function retrieves the facet properties and collected data for a specific facet of a data collector surface.
Syntax success = DataCollectorSurfGetDatum( surf, datumID, tDatum )
Parameters success (Boolean) Return value indicating whether the datum was successfully retrieved from the data collector (True) or not (False).
surf As Long Node number of the data collector surface whose datum is being retrieved.
datumID As Long ID number of the datum being retrieved. The ID number has no physical significance and simply represents an index into the datum array for the data collector surface.
tDatum As T_COLLECTED_DATUM After the function executes, this data structure is populated with the retrieved datum values.
Example The example below demonstrates how to loop over all datum in all active data collector surfaces and zero-out the power entries for any datum that does not meet a specific incident ray count threshold value.
Sub Main
Dim tDatum As T_COLLECTED_DATUM Dim nDatum As Long, curDatum As Long 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
'Loop over all datum on the data collector nDatum = DataCollectorSurfGetDatumCount( curNode ) For curDatum = 0 To nDatum-1
'If ray counts are < threshold, zero out the power values success = DataCollectorSurfGetDatum( curNode, curDatum, tDatum ) If (success) And (tDatum.incidentRayCount<10) Then tDatum.absorbedPower = 0.0 tDatum.incidentPower = 0.0 success = DataCollectorSurfSetDatum( curNode, curDatum, tDatum ) End If
Next End If End If End If End If Next
End Sub
See Also Data Collector Surface Scripting DataCollectorSurfGetDatumCount DataCollectorSurfIsCollectData DataCollectorSurfIsDataAvailable DataCollectorSurfReadCollectedDataFile DataCollectorSurfSetCollectData DataCollectorSurfWriteCollectedDataFile
|