Navigation: Scripting Reference Manual > Functions & Subroutines > ARNSetDataSpatialUnits

 

ARNSetDataSpatialUnits

 

Contact Us: fredsupport@photonengr.com

 

Description

This command sets the data spatial units field for an Analysis Results Node.  This field should be set when the data spatial units is different from the axes spatial units.  For example, a grid of illuminance data might be stored in units of LUX (lumens/meter^2) while its axes are in units of inches.  If the data spatial units does match the axes spatial units, then this parameter value is typically "Unset".

 

Note that this does NOT change the actual data values.  The user is responsible for performing any rescaling of the data that might be necessary.

 

 

Syntax

ARNSetDataSpatialUnits arnNode, dataSpatialUnits

 

 

Parameters

arnNode As Long

Node number of the ARN whose data spatial units are being set.

 

dataSpatialUnits As String

String identifying the data spatial units type.  Valid strings match those in the Preferences > Units of Measurement: Length Units (for new systems) drop down list.

 

 

Example

The following example calculates an irradiance spread function, retrieves and prints the value of the unmodified data spatial units, explicitly resets the data spatial units type, and then retrieves and prints the new data spatial units type for verification.

 

Sub Main

 

    Dim anaNode As Long

    anaNode = FindFullName( "Analysis Surface(s).sourceAnalysis" )

 

    EnableTextPrinting False

    ClearOutputWindow

    DeleteRays()

    ARNDeleteAllNodes()

    CreateSources()

 

    Dim rayCnt As Long, arnNode As Long

    rayCnt = IrradianceToARN( anaNode, "Source Irradiance", arnNode )

 

    Dim sUnits As String

    EnableTextPrinting True

    sUnits = ARNGetDataSpatialUnits( arnNode )

    Print "Original data units are " & sUnits

 

    sUnits = "mm"

    ARNSetDataSpatialUnits( arnNode, sUnits )

    Print "Reset data spatial units to " & sUnits

 

    sUnits = ARNGetDataSpatialUnits( arnNode )

    Print "Retrieved modified data units are " & sUnits

 

 

End Sub

 

 

See Also

ARN Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC