Navigation: Scripting Reference Manual > Functions & Subroutines > InitSourceDirLaserDiode

 

InitSourceDirLaserDiode

 

Contact Us: fredsupport@photonengr.com

 

Description

Initializes the members of a T_SOURCEDIRLASERDIODE structure to default values.

 

Syntax

InitSourceDirLaserDiode ld

 

Parameters

ld As T_SOURCEDIRLASERDIODE

Data structure containing the parameters of the Laser Diode Beam ray direction specification.  The default values are:

angleType                    "Half width at 1/e amplitude point"

focusX                              0

focusY                              0

numX                              8

numY                              8

semiAngX                    10

semiAngY                    10

 

 

Example

The following script demonstrates how to query, retrieve and modify the Laser Diode Beam ray direction specification of a source node.

 

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

SetSourceDirLaserDiode

GetSourceDirLaserDiode

T_SOURCEDIRLASERDIODE

 

 

 

 

 

Copyright © Photon Engineering, LLC