Navigation: Scripting Reference Manual > Functions & Subroutines > IsElement

 

IsElement

 

Contact Us: fredsupport@photonengr.com

 

Description

Identifies if a specific entity in the FRED document's tree is an element or not.  Element type objects are lenses, mirrors, prisms, element primitives and custom elements.

 

Syntax

isElem = IsElement ( n )

 

Parameters

isElem (Boolean)

True if the entity is an element, False otherwise.

 

n As Long

Node number of the entity.

 

 

Example

The script below loops over all entities in the document and prints their full name and True or False depending on whether the entity is an element.

 

 Sub Main

 

    ClearOutputWindow()

    EnableTextPrinting(True)

 

    Dim entCount As Long

    entCount = GetEntityCount()

 

    Print "Entity Name" & Chr(9) & "Is Element?"

 

    Dim curEnt As Long

    For curEnt = 4 To entCount-1

        Print GetFullName( curEnt );

        If IsElement( curEnt) Then

            Print "True"

        Else

            Print "False"

        End If

    Next

 

End Sub

 

See Also

Entity Information Script Commands

 

 

 

 

 

Copyright © Photon Engineering, LLC