Navigation: Scripting Reference Manual > Functions & Subroutines > SetSourceDirLaserDiode

 

SetSourceDirLaserDiode

 

Contact Us: fredsupport@photonengr.com

 

Description

Modifies the source to use the Laser Diode Beam ray direction specification with the requested parameters.

 

Syntax

SetSourceDirLaserDiode srcNode, ld

 

Parameters

srcNode As Long

Node number of the source whose specification is being modified.

 

ld As T_SOURCEDIRLASERDIODE

Data structure containing the parameters of the Laser Diode Beam ray direction specification.

 

 

Example

The following script demonstrates how to query, retrieve and modify the Laser Diode Beam ray direction specification of a source node.  If the construction of the source parameters (all controls on the Detailed Source dialog) are consistent with the Laser Diode Beam (coherent) type of Source Primitive, a Detailed Source node will be converted to its Source Primitive representation when this subroutine is executed.

 

Sub Main

 

          Dim ld As T_SOURCEDIRLASERDIODE

          Dim srcNode As Long

          Dim success As Boolean

 

          'Source node being queried

          srcNode = FindFullName( "Optical Sources.LaserDiodeSource" )

 

          'Does the source node have laser diode beam ray directions?

          If IsSourceDirLaserDiode( srcNode ) Then

 

                    'Retrieve the source's laser diode direction specifications

                    success = GetSourceDirLaserDiode( srcNode, ld )

                    Print "Current Laser Diode Parameters: "

                    Print Chr(9) & "Angle Type: " & Chr(9) & ld.angleType

                    Print Chr(9) & "X Focus: " & Chr(9) & ld.focusX

                    Print Chr(9) & "Y Focus: " & Chr(9) & ld.focusY

                    Print Chr(9) & "X Samples: " & Chr(9) & ld.numX

                    Print Chr(9) & "Y Samples: " & Chr(9) & ld.numY

                    Print Chr(9) & "X Semi Ang: " & Chr(9) & ld.semiAngX

                    Print Chr(9) & "Y Semi Ang: " & Chr(9) & ld.semiAngY

 

                    'Set the default ray directions back to the source

                    InitSourceDirLaserDiode ld

                    SetSourceDirLaserDiode srcNode, ld

                    Print "Source reset to default laser diode ray directions."

 

          End If

 

End Sub

 

 

See Also

IsSourceDirLaserDiode

GetSourceDirLaserDiode

InitSourceDirLaserDiode

T_SOURCEDIRLASERDIODE

 

 

 

 

 

Copyright © Photon Engineering, LLC