Navigation: Scripting Reference Manual > Functions & Subroutines > SourcePrimGetTypeSource

 

SourcePrimGetTypeSource

 

Contact Us: fredsupport@photonengr.com

 

Description

This function queries a source node and returns a string indicating the type of Source Primitive it represents.

 

Syntax

spType = SourcePrimGetTypeSource( spNode )

 

 

Parameters

spType (String)

Return string indicating the Source Primitive type that the queried source represents.  If the queried source node is not a Source Primitive, the return string will be "Detailed".  Possible return values are:

Plane Wave (coherent)

Plane Wave (incoherent)

Point Source (coherent)

Point Source (incoherent)

Laser Beam (00 mode)

Astigmatic Gaussian Beam

Laser Diode Beam (coherent)

M-Squared Laser Beam

Lambertian Plane

Lambertian Surface

Rayfile Source

Random Volume into a sphere

Ray Fan

Solar Source (simple)

Laser Diode (incoherent)

LED (far-field)

Bitmap

Detailed

 

spNode As Long

Node number of the source being queried.

 

 

Example

The example below demonstrates how to query a source node for its Source Primitive string type and use the returned string as a qualifier for converting the node to a Detailed Source representation.

 

Sub Main

 

    'Retrieve source primitive type

    Dim spNode As Long, spType As String

    spNode = FindFullName( "Optical Sources.LED (far-field)" )

    spType = SourcePrimGetTypeSource( spNode )

 

    'Convert source if it matches a specific type

    Dim cSuccess As Boolean

    If spType = "Point Source (coherent)" Then

        cSuccess = SourcePrimConvertToDetailed( spNode )

        Update

    End If

 

    Print "Success?" & Chr(9) & cSuccess

 

End Sub

 

See Also

Source Primitive Script Commands

AddSourcePrim

 

 

 

 

 

Copyright © Photon Engineering, LLC