Description Writes an array of data to a text file.
Syntax WriteToPlotFile fname, ana, data
Parameters fname As String The text file name.
ana As T_ANALYSIS A T_ANALYSIS structure which defines the location and size in 3D space of the data in the array.
data() As Double The array of data to be written to the file.
Remarks This subroutine writes the data to a text file in the current working directory. Since the file format is the same as the format used by FRED's 3D charts, this subroutine provides a convenient means of using the scripting language to produce plot files directly viewable by FRED. The file can also be easily imported into spreadsheet applications such as Microsoft Excel.
See Also
Example This example illustrates the use of WriteToPlotFile. A common use for this command is as a companion to the Irradiance command. That is, you can call the Irradiance command to compute irradiance data in a 2D array, and then call the WriteToPlotFile command to write the irradiance distribution to a file.
1. Declare a T_ANALYSIS structure, an array to hold the irradiance values and a string for the file name. 2. Assign a file name to the declared string. 3. Use LoadAnalysis to populate the T_ANALYSIS structure based upon a predefined Analysis surface. 4. Issue the Irradiance command to calculate the irradiance in global coordinate system and place the result in the array irrad. 5. Write the data from the array irrad to the text file "myirrad.txt".
'step 1
|