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

 

DeleteSrcNthAcceptanceRegion Subroutine

 

Contact Us: fredsupport@photonengr.com

 

Description

This subroutine deletes the N’th Acceptance Filter region from a source node.

 

Syntax

DeleteSrcNthAcceptanceRegion( srcNode, nFilter )

 

Parameters

srcNode As Long

Node number of the source being modified.

 

nFilter As Long

Index (0-based) of the Acceptance Filter region being deleted.

 

Example

The example below shows how to query a source node for the number of Acceptance Filter regions and then delete each region in a reverse loop.  The last remaining region cannot be deleted, but can be marked as inactive.

 

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 delete them in reverse order

    Dim curFilt As Long

    For curFilt = nFilters-1 To 0 Step -1

        DeleteSrcNthAcceptanceRegion( srcNode, curFilt )

    Next

 

    'Update the model

    Update

 

End Sub

 

See Also

Sources Acceptance Filter Script Commands

 

 

 

 

 

 

Copyright © Photon Engineering, LLC