Navigation: Scripting Reference Manual > Functions & Subroutines > SourcePrimGetParmValue

 

SourcePrimGetParmValue

 

Contact Us: fredsupport@photonengr.com

 

Description

This function retrieves the value of a specific Source Primitive parameter.  Each parameter is accessed using a 0-based index value (as seen in the GUI dialog for a Source Primitive).  Note that not all Source Primitive types are eligible to use this command and the function will halt with an error if an invalid Source Primitive type is queried.  Refer to the Source Primitive Parameters Help topic for more information on parameter indexing, retrieval and modification.

 

 

Syntax

parmVal = SourcePrimGetParmValue( spNode, parmIndex )

 

 

Parameters

parmVal (Variant)

Returned parameter value.

 

spNode As Long

Node number of the Source Primitive being queried.

 

parmIndex As Long

Parameter index whose parameter value is being retrieved.

 

Example

The example below demonstrates iterate over all parameters of a Source Primitive node and retrieve the value of each.

 

Sub Main

 

    Dim spNode As Long

    spNode = FindFullName( "Optical Sources.Point Source (incoherent)" )

    Print "SP type being queried: " & SourcePrimGetTypeSource( spNode )

 

    'Number of parameters in the source primitive

    Dim parmCount As Long

    parmCount = SourcePrimGetParmCount( spNode )

 

    Dim curParm As Long

    Dim parmVal As Variant

    Dim parmDesc As String

    For curParm = 0 To parmCount-1

 

        'Retrieve description and value

        parmDesc = SourcePrimGetParmDescription( spNode, curParm )

        parmVal  = SourcePrimGetParmValue( spNode, curParm )

 

        'Report information to output window

        Print curParm;

        Print parmVal;

        Print parmDesc

 

    Next

 

End Sub

 

See Also

Source Primitive Script Commands

SourcePrimSetParmValue

SourcePrimGetParmLaser

SourcePrimGetParmLEDff

SourcePrimGetParmPtSrcCohList

SourcePrimGetParmPtSrcCohSingle

SourcePrimGetParmRayFan

 

 

 

 

 

Copyright © Photon Engineering, LLC