Navigation: Scripting Reference Manual > Functions & Subroutines > ElemSetCPC

 

ElemSetCPC

 

Contact Us: fredsupport@photonengr.com

 

Description

This subroutine sets the construction parameter values for a CPC element node.

 

Syntax

ElemSetCPC cpcNode, tCpc

 

Parameters

cpcNode As Long

Node number of the CPC whose construction parameter values are being set.

 

tCpc As T_CPC_STRUCT

Structure which is populated with the CPC construction parameter values. 

 

 

Example

The following example creates a CPC with the default settings, retrieves the values for each of the parameters and prints them to the output window, then applies new construction parameters to the CPC.

 

Sub Main()

 

    Dim tCpc As T_CPC_STRUCT

    Dim tCpcData As T_CPC_DATA

    Dim tEnt As T_ENTITY

    Dim cpcNode As Long

 

    ' initialize and add new CPC node

    InitEntity( tEnt )

    tEnt.name = "New CPC"

    cpcNode = ElemAddCPC( tEnt )

    If cpcNode > 0 Then

        Print "CPC created at node " & cpcNode

    Else

        End

    End If

 

    ' update the document

    Update

 

    ' retrieve default CPC construction data

    ElemGetCPC( cpcNode, tCpcData )

    Print "Input Semi-ap: " & Chr(9) & tCpcData.InputSw

    Print "Output Semi-ap: " & Chr(9) & tCpcData.OutputSw

    Print "Concentration Ratio: " & Chr(9) & tCpcData.ConcRatio

    Print "Length: " & Chr(9) & tCpcData.Length

    Print "Acceptance Angle: " & Chr(9) & tCpcData.Theta_deg

    Print "Focal Length: " & Chr(9) & tCpcData.FocalLength

    Print "Round Aperture?: " & Chr(9) & tCpcData.Round

    Print "Trough Semi-width: " & Chr(9) & tCpcData.TroughSw

    Print "Sold Body?: " & Chr(9) & tCpcData.Solid

    Print "Thin Wall?: " & Chr(9) & tCpcData.Thin

    Print "Wall Thickness: " & Chr(9) & tCpcData.thickness

 

 

    ' modify CPC construction parameters

    tCpc.ParamA        = "Input Semi-ape"

    tCpc.ValA          = 10

    tCpc.ParamB        = "Output Semi-ape"

    tCpc.ValB          = 5

    tCpc.Solid         = False 'Solid or hollow body

    tCpc.Thin          = False 'Thin or thick wall

    tCpc.thickness     = 1.0   'If thick walled, gives thickness

    tCpc.Round         = True  'Shape of the element (round or trough)

    tCpc.TroughSw      = 1     'If trough, gives semi-width

    tCpc.TrucLength_pc = 100   'Truncated length (%)

    ElemSetCPC cpcNode, tCpc

 

    Update

 

End Sub

 

See Also

T_CPC_DATA

T_CPC_STRUCT

Element Primitive Script Commands

Element Composite (boolean) Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC