Description Given an indexed list of wavelength specification options supported by a Source Primitive, this function retrieves the type string ("Single", "List", etc.) corresponding to a specific index. For example, the Point Source (incoherent) type Source Primitive supports three wavelength specification options; Single, List and Random according to spectrum. These options are given by indexes 0-2 when querying a Source Primitive, and the SourcePrimGetWavelSpectType function reports the string label corresponding to each index.
The purpose of this command is to allow programmatic iteration over all supported wavelength specification options, if needed.
Syntax optType = SourcePrimGetWavelSpectType( spNode, optIdx )
Parameters optType (String) Returned string describing the wavelength option type at index optIdx.
spNode As Long Node number of the Source Primitive being queried.
optIdx As Long Index into the wavelength generation options list supported by the Source Primitive, whose string type is being retrieved.
Example The example below demonstrates how to retrieve the number of supported wavelength options for a Source Primitive and then loop over each option and print its corresponding meaning.
Sub Main
'Source primitive being queried Dim spNode As Long spNode = FindFullName( "Optical Sources.Point Source (coherent) 1" )
'Retrieve number of supported wavelength options Dim optCount As Long optCount = SourcePrimGetWavelSpectCount( spNode )
'Iterate over options and print their type Dim curOpt As Long, curType As String
Print "Supported wavelength options: Print "Option" & Chr(9) & "Type" For curOpt = 0 To optCount-1
curType = SourcePrimGetWavelSpectType( spNode, curOpt ) Print curOpt; Print curType
Next
End Sub
See Also Source Primitive Script Commands
|