Description Data structure for the values of the RaySummaryInfo dictionary.
Definition Type T_RAYSUMMARY raycount As Long raypower As Double End Type
Members raycount Number of rays.
raypower Total incoherent radiometric power in the rays.
Example The following script computes the ray summary information and then prints the formatted output to the output window. Sub Main
Dim RaySumDict As Variant Dim key, rs As T_RAYSUMMARY, TabStr As String
'Call RaySummaryInfo, return result into the dictionary variable Set RaySumDict = RaySummaryInfo()
'Begin printing the dictionary results to the output window TabStr = Chr(9) & Chr(9) & Chr(9) Print " " Print "Count" & Chr(9) & "Power" & TabStr & " Entity Name or Ray Status" Print "------" & Chr(9) & "------" & TabStr & " ------------------------------"
'For each key in the dictionary, print out the data For Each key In RaySumDict
'Retrieve the T_RAYSUMMARY info for the current key rs = RaySumDict.item( key ) Print rs.raycount & Chr(9) & rs.raypower & TabStr;
'Print the corresponding key information, differentiating between 'ray status types and node number types 'If Long, then the key is a node number or -1 designation If TypeName$( key ) = "Long" Then If key >= 0 Then Print " [" & key & "] " & GetFullName( key ) Else Print " " & key End If 'If String, then key is a ray status designation ElseIf TypeName$( key ) = "String" Then Print " Ray Status: " & key End If
Next
End Sub
The example script below demonstrates how to retrieve specific information from the ray summary info dictionary. Sub Main
'Define the ray summary dictionary and the 'ray summary data structure Dim summaryDict As Variant Dim rs As T_RAYSUMMARY
'Surface of interest 'Perform raytrace DeleteRays() TraceCreate()
'Get ray summary information Set summaryDict = RaySummaryInfo()
'Specifically ask for how many rays had unresolved materials 'by using the dictionary key "unresolved material" rs = summaryDict( "unresolved material" ) Print "Rays with material errors:" Print vbTab & "Count:" & vbTab & rs.raycount Print vbTab & "Power:" & vbTab & rs.raypower
'Specifically ask for how many rays ended on a particular surface of interest 'by using a dictionary key that matches the node number of the object. Dim sNode As Long sNode = FindFullName( "Geometry.Universe.Hemisphere Inner Wall" ) rs = summaryDict( sNode ) Print "Rays on surface of interest:" Print vbTab & "Count:" & vbTab & rs.raycount Print vbTab & "Power:" & vbTab & rs.raypower
End Sub
See Also
|