Description This function sets the configuration parameters for a Point Source (coherent) type Source Primitive using the Single wavelength option. For a Point Source (coherent) type that uses the List wavelength option, the SourcePrimSetParmPtSrcCohList function should be used.
Syntax success = SourcePrimSetParmPtSrcCohSingle( spNode, tPtSrc, wl )
Parameters success (Boolean) Returned boolean indicating whether the parameters were successfully applied to the source node.
spNode As Long Node number of the Point Source (coherent) type Source Primitive being modified.
tPtSrc as T_SOURCEPRIMPTSRCCOH Data structure containing the configuration parameters of the Point Source.
wl As Double Source wavelength in microns.
Example The example below demonstrates how to add a Point Source (coherent) type Source Primitive using the Single wavelength option.
Sub Main
Dim spNode As Long Dim spType As String Dim tEnt As T_ENTITY
'String specifying the type of SP being created spType = "Point Source (coherent)"
'Generic entity information InitEntity( tEnt ) tEnt.name = spType tEnt.Description = "Added via scripting"
'Add the node spNode = AddSourcePrim( spType, tEnt ) Print "Source primitive added at node number " & spNode
'Configure parameter settings Dim success As Boolean Dim tPtSrc As T_SOURCEPRIMPTSRCCOH tPtSrc.num = 15 'Number of angular samples tPtSrc.phi = 30 'Semi-angle of emission tPtSrc.PowerWatts = 1.0 'Power emitted in units of Watts success = SourcePrimSetParmPtSrcCohSingle( spNode, tPtSrc, 0.532 )
'Source draw color R=255, G=0, B=0 SourcePrimSetDrawColor( spNode, 255, 0, 0 )
'Update the document Update
End Sub
See Also Source Primitive Script Commands SourcePrimGetParmPtSrcCohSingle
|