Navigation: Scripting Reference Manual > Functions & Subroutines > GetApertureCurveAlgorithm

 

GetApertureCurveAlgorithm

 

Contact Us: fredsupport@photonengr.com

 

Description

This function gets the current algorithm from an Aperture Curve Collection.  Please see the Aperture Curve Collection topic.

 

 

Syntax

algo = GetApertureCurveAlgorithm( cNode )

 

 

Parameters

algo (Long)

The return value indicating which algorithm is currently being used by the Aperture Curve Collection.  Return values are:

Return Value

Algorithm

1

Use group numbers

2

Sequential logic

3

Sequential with absorb ==> miss

 

cNode As Long

Node number of the Aperture Curve Collection whose algorithm is being retrieved.

 

Example

The example below shows how to retrieve  the current algorithm setting from an aperture curve collection and then enter a loop which iterates over the available algorithms, traces and performs an irradiance analysis and displays the result.

 

Sub Main

 

    DeleteRays()

    ARNDeleteAllNodes()

    ClearOutputWindow()

 

    Dim cNode As Long

    cNode = FindFullName( "Geometry.Complex Aperture.Ap Curve" )

 

    Dim ana As Long

    ana = FindFullName( "Analysis Surface(s).Detector" )

 

    'Retrieve the current algorithm

    Dim algo As Long

    algo = GetApertureCurveAlgorithm( cNode )

    Print "Current ap curve algorithm = " & algo

    Print ""

 

    'Loop over the algorithms, trace, calculate the irradiance and display

    Dim arn As Long

    For algo = 1 To 3

 

        SetApertureCurveAlgorithm( cNode, algo )

        Update

 

        EnableTextPrinting(False)

        DeleteRays()

        TraceCreate()

        IrradianceToARN( ana, "Algorithm " & algo, arn )

        EnableTextPrinting(True)

 

        Print "Displaying result from algorithm " & algo

        ARNDisplayInChart( arn, "" )

 

    Next

 

End Sub

 

 

See Also

Curve Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC