Navigation: Scripting Reference Manual > Functions & Subroutines > SourcePrimGetWavelSpectValue

 

SourcePrimGetWavelSpectValue

 

Contact Us: fredsupport@photonengr.com

 

Description

This function retrieves the type string indicating the wavelength generation method being used by a Source Primitive.  The wavelength options supported for each Source Primitive type are given in their respective Help topics (Source Primitives).

 

 

Syntax

wlType = SourcePrimGetWavelSpectValue( spNode )

 

 

Parameters

wlType (String)

Returned string of the wavelength generation option currently in use by the Source Primitive node ("Single", "List", etc.).

 

spNode As Long

Node number of the Source Primitive being queried.

 

 

Example

The example below demonstrates how to loop over all source nodes, check if each source is a Source Primitive, check if each Source Primitive is using the Single wavelength method option, and then update the Single wavelength value of any qualifying source node.

 

Sub Main

 

    'Wavelength to apply

    Dim wl As Double

    wl = 0.55

 

    'Loop over all source nodes

    Dim curSrc As Long, wlType As String

    curSrc = GetChild( FindFullName( "Optical Sources" ) ) 'get first source

    While curSrc > 0

        'Is node a source primitive?

        If Not( SourcePrimGetTypeSource( curSrc ) = "Detailed" ) Then

 

            'Get its wavelength generation method

            wlType = SourcePrimGetWavelSpectValue( curSrc )

 

            'Does source use the Single option?

            If wlType = "Single" Then

                SourcePrimSetWavelSingle( curSrc, wl )

                Print "Source Primitive " & GetName( curSrc ) & " Single wavelength value updated."

            End If

 

        End If

 

        'Get the next source node on the tree

        curSrc = GetSibling( curSrc )

    Wend

 

    'Update the model

    Update

 

End Sub

 

 

See Also

Source Primitive Script Commands

SourcePrimGetTypeSource

SourcePrimGetWavelSingle

SourcePrimGetWavelSpectCount

SourcePrimSetWavelSingle

SourcePrimSetWavelSpectValue

 

 

 

 

 

Copyright © Photon Engineering, LLC