Description This function reads raytrace path data from a binary file with an option to merge or replace existing paths and returns a count of the number of paths that were read. A Python script utility ( <install dir>\Resources\Samples\Scripts\Python\ListFRPFileContents.py ) is also provided with the FRED installation that can process and report the raypath file data independently.
Syntax pCount = ReadRaytraceRayPathsFromFile( fName, bMerge )
Parameters pCount (Long) The number of paths that were read from the file.
fName As String The full path name of the binary raypath file that will be read.
bMerge As Boolean Boolean argument indicating whether the paths being read will be merged into the exiting paths (True) or will replace the existing paths (False).
Example The following script demonstrates how to raytrace with paths in a loop, saving raypath files on each iteration and then re-combining them in a merge operation. Sub Main()
'Base directory where raypath files will be saved Dim baseDir As String baseDir = "C:\temp\"
'Delete any existing raytrace paths SetUserDefinedRayPathMode( False ) PathDeleteAll()
'Number of raytrace loops we would like to take Dim loopCount As Long loopCount = 3
'Advanced raytrace initialization Dim tAdv As T_ADVANCEDRAYTRACE InitAdvancedRaytrace( tAdv ) tAdv.draw = False tAdv.rayPaths = True
'Raytrace loop with path file saving Dim curLoop As Long, pCount As Long Dim curPathFile As String pCount = 0 For curLoop = 1 To loopCount 'Trace and save current paths AdvancedRaytrace( tAdv ) curPathFile = "rayPaths_" & CStr(curLoop) pCount = pCount + SaveRaytraceRayPathsToFile( baseDir & curPathFile )
'Delete current paths PathDeleteAll() Next Print pCount & " paths saved to file(s)"
'Go back and load all paths from files pCount = 0 For curLoop = 1 To loopCount
curPathFile = "rayPaths_" & CStr(curLoop) pCount = pCount + ReadRaytraceRayPathsFromFile( baseDir & curPathFile, True)
Next Print pCount & " paths read from file(s)"
End Sub
See Also
|