Navigation: Scripting Reference Manual > Functions & Subroutines > SetDescription

 

SetDescription

 

Contact Us: fredsupport@photonengr.com

 

Description

This command sets the description of an entity without the need for a T_ENTITY data structure. 

 

 

Syntax

SetDescription entNode, entDesc

 

 

Parameters

entNode As Long

Node number of the entity whose description string is being set.

 

entDesc As String

Description to be given to entNode.

 

 

Example

The following example loops over entities on the object tree and looks for surfaces which have gratings applied.  If any are found, the surface name and description are reset.

 

Sub Main

 

    'Loop over entities on tree

    Dim curEnt As Long

    Dim curName As String

    For curEnt = 0 To GetEntityCount()-1

        If IsSurface( curEnt ) Then

            If IsDiffractingSurface( curEnt ) Then

                'Entity is both a surface AND a grating

                curName = GetName( curEnt )

                curName = curName & " Grating"

                SetName( curEnt, curName )

                SetDescription( curEnt, "Diffraction grating surface" )

            End If

        End If

    Next curEnt

    Update

 

End Sub

 

See Also

Entity Info Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC