Navigation: Scripting Reference Manual > Functions & Subroutines > SetSurfRayPathNodes

 

SetSurfRayPathNodes

 

Contact Us: fredsupport@photonengr.com

 

Description

Sets the ray path node number assignment for a given array of surface or source objects.  The objects will report themselves as the assigned node number for ray path purposes.

 

This command is intended to be used to easily mimic the same Ray Path Node Number(s) operations as presented via the GUI, and additionally control the recursion, as where the GUI functionality always employs a recursive hierarchy the use of this command instead permits the recursive behavior to be controlled.

 

This command can also be used to explicitly set ray path node ID's in the same manner as SetSurfRayPathNode, but can operate on several surfaces at a time.

 

 

Syntax

SetSurfRayPathNodes nodes(), pathNode, recurse

 

 

Parameters

nodes() As Long

An array of node IDs which will be assigned a new raypath node ID. These node ID's must be a surface or source or the function will halt with error, "A referenced entity is not of the correct type".

 

pathNode As Variant

Can have one of several different values:

 

                    String "reset" - reset each node's raypath node ID to its natural default value. This is the same as the "Reset to Default" GUI control.

 

                    String "parent" - set each node's raypath node ID to the node ID of the node's parent. This is the same as the "Set to Parent Element" GUI control.

 

                    String "descendent" - set the raypath node ID of each node's descendent to the node ID of node. This is the same as the "Set to Selected Node" GUI control.

 

                    Long  n - set each node's raypath node ID to value "n"..

 

recurse As Boolean

          If True then the ray node path numbering selection will apply recursively to the children of the node ID.

 

Example

The following example code populates a list of nodes that share a keyword, then sets the Ray Path Node Number of each node to its immediate parent, without affecting any child nodes.

 

Sub Main

          Dim nodes() As Long, kws() As Long, itemNodes() As Long

 

          ReDim kws(0)

          kws(0) = KeywordFind( "Towards Mid Aperture" )

 

          'populate itemNodes array with items matching above keywords

          KeywordsGetAppliedItems( "geo", kws( ), itemNodes() )

 

          'Set Ray Path Node Number of each item to its immediate parent, but do not also set any children

          SetSurfRayPathNodes(itemNodes(), "parent", False)

 

End Sub

 

 

 

See Also

Ray Path Node Number(s)

SetSurfRayPathNode

GetSurfRayPathNode

 

 

 

 

 

Copyright © Photon Engineering, LLC