Navigation: Scripting Reference Manual > Functions & Subroutines > SourcePrimGetWavelSingle

 

SourcePrimGetWavelSingle

 

Contact Us: fredsupport@photonengr.com

 

Description

This subroutine retrieves the wavelength value from a Source Primitive node whose wavelength type specification is Single.  If the wavelength type specification is not Single, the subroutine will halt with an error.

 

 

Syntax

SourcePrimGetWavelSingle( spNode, wavl )

 

 

Parameters

spNode As Long

Node number of the Source Primitive being queried.

 

wavl As Double

After the subroutine executes, this parameter contains the retrieved value of the Single wavelength specification.

 

Example

The example below demonstrates how to retrieve the wavelength type specification from a source primitive node and then, if applicable, retrieve the Single wavelength value.

 

Sub Main

 

    'Source primitive being queried

    Dim spNode As Long

    spNode = FindFullName( "Optical Sources.Point Source (coherent) 1" )

 

    'Retrieve wavelength specification type

    Dim wlVal As Double, wavlType As Variant

    wavlType = SourcePrimGetWavelSpectValue( spNode )

 

    'If appropriate, retrieve Single wavelength value type

    If wavlType = "Single" Then

        SourcePrimGetWavelSingle( spNode, wlVal )

        Print "Single wavelength value: " & wlVal

    Else

        Print "Wavelength specification type is: " & wavlType

    End If

 

End Sub

 

See Also

Source Primitive Script Commands

SourcePrimGetWavelSpectValue

SourcePrimSetWavelSpectValue

SourcePrimSetWavelSpectValue

 

 

 

 

 

Copyright © Photon Engineering, LLC