Navigation: Scripting Reference Manual > Functions & Subroutines > GetSrcNthAcceptanceRegion Subroutine

 

GetSrcNthAcceptanceRegion Subroutine

 

Contact Us: fredsupport@photonengr.com

 

Description

This subroutine retrieves the parameters of the N’th Acceptance Filter region from a designated source and stores them in a T_ACCEPTANCE_FILTER data structure.

 

Syntax

GetSrcNthAcceptanceRegion( srcNode, nfilter, tFilter )

 

Parameters

srcNode As Long

Node number of the source whose N’th Acceptance Filter region parameters are being retrieved.

 

nFilter As Long

The index (0-based) of the Acceptance Filter region being retrieved.

 

tFilter As T_ACCEPTANCE_FILTER

The parameters of the Acceptance Filter will be stored in this data structure after the subroutine executes.

 

Example

The example below demonstrates how to count the number of Acceptance Filter regions of a given source and then loop over each region to retrieve the filter settings, set the filter active flag to True and then set the updated specification back to the filter.

 

Sub Main

 

    'Source we want to modify

    Dim srcNode As Long

    srcNode = FindFullName( "Optical Sources.Source 1" )

 

    'Retrieve the count of acceptance filters

    Dim nFilters As Long

    nFilters = GetSrcAcceptanceRegionCount( srcNode )

 

    'Loop over the acceptance filters and activate them

    Dim tFilt As T_ACCEPTANCE_FILTER

    Dim curFilt As Long

    For curFilt = 0 To nFilters-1

        GetSrcNthAcceptanceRegion( srcNode, curFilt, tFilt )

        tFilt.isActive = True

        SetSrcNthAcceptanceRegion( srcNode, curFilt, tFilt )

    Next

 

    'Update the model

    Update

 

End Sub

 

See Also

Sources Acceptance Filter Script Commands

 

 

 

 

 

 

 

Copyright © Photon Engineering, LLC