Navigation: Scripting Reference Manual > Functions & Subroutines > FindFullName

 

FindFullName

 

Contact Us: fredsupport@photonengr.com

 

Description

This function returns the node number of the first entity in the Optical Sources, Geometry, or Analysis Surface(s) folder with the given full name (case sensitive).  This function uses the full hierarchical name of the entity (e.x. "Geometry.Lens 1.Surface 1").  The function string (ex. FindFullName( "Geometry.Lens 1.Surface 1" ) ) can also be easily generated from the GUI by right mouse clicking on the desired node in the object tree and choosing the "Copy Find-Name Command to Clipboard" feature.  Using the GUI option eliminates bad node number referencing in scripts that result from typos.

 

Syntax

n = FindFullName ( fullName )

 

Parameters

n (Long)

Returned node number of the entity referenced by fullName.  If no match is found, a -1 is returned.

 

fullName As String

Full hierarchical name of the entity whose node number is intended to be returned (case sensitive).

 

Example

The example below demonstrates how to use the FindFullName function to retrieve the node number of a source by its full name and then use the returned node number to modify the source parameters.

 

Sub Main

 

    'Retrieve the node number of the source

    Dim srcNode As Long

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

 

    'Retrieve the ray positions specification

    Dim semiX As Double, semiY As Double

    Dim nRays As Long, isEllipse As Boolean

    GetSourcePosGridRandom( srcNode, semiX, semiY, nRays, isEllipse )

 

    'Change the number of source rays

    nRays = 10000

 

    'Modify the source node

    SetSourcePosGridRandom( srcNode, semiX, semiY, nRays, isEllipse )

 

    'Update the model

    Update

 

End Sub

 

 

See Also

FindName

FindNameNoCase

FindMaterial

FindScatter

FindRaytraceCtrl

 

 

 

 

 

Copyright © Photon Engineering, LLC