Navigation: Scripting Reference Manual > Functions & Subroutines > SetAsphereOddCoef

 

SetAsphereOddCoef

 

Contact Us: fredsupport@photonengr.com

 

Description

This function sets the value of an odd-order aspheric coefficient on an aspheric surface.

 

Syntax

SetAsphereOddCoef n, indx, coef

 

Parameters

n As Long

Node number of the surface being modified.

 

indx As Long

Index of the coefficient being set.  Odd order coefficients have the convention that indx = (n-1)/2, where n is the order of the coefficient being set.

 

coef As Double

Value of the coefficient being set.

 

Example

The example below sets the 5th order coefficient of a General Asphere type surface to a value of 5.

 

Sub Main

          

    Dim sNode As Long

    sNode = FindFullName( "Geometry.Aspherics.General Asphere" )

 

    If GetAsphereOddCount( sNode ) < 0 Then

 

        Print "Surface has no odd-order coefficients."

 

    Else

 

        Dim idx As Long

        idx = 2

   

        Dim cVal As Double

        cVal = 5

        SetAsphereOddCoef( sNode, idx, cVal )

        Print "Coefficient " & 2*idx+1 & " set to value " & cVal

 

        Update

 

    End If

 

End Sub

 

See Also

AddAsphere

GetAsphere

SetAsphere

GetAsphereEvenCount

GetAsphereOddCount

GetAsphereEvenCoef

GetAsphereOddCoef

SetAsphereEvenCoef

 

 

 

 

 

 

Copyright © Photon Engineering, LLC