Navigation: Scripting Reference Manual > Functions & Subroutines > GetType

 

GetType

 

Contact Us: fredsupport@photonengr.com

 

Description

Retrieves the type of a specified FRED entity.

 

Syntax

type = GetType ( n )

 

Parameters

type (String)

The type of the FRED entity.

 

n As Long

Node number of the FRED entity.

 

Remarks

This function retrieves the type of a specified FRED entity.  If there is a problem, the function posts an error and returns an empty string.

 

Some examples of common returned type strings are:

String Type

Description

"Plane"

Plane surface

"Conic"

Conic surface

"Asphere"

Standard aspheric surface

"Asphere"

General aspheric surface

"Tube"

Cylinder surface

"ConicFoci"

Conic Foci surface

"TabulatedCylinder"

Tabulated Cylinder surface

"SplineSurf"

Spline surface

"RuledSurf"

Ruled surface

"RevolveSurf"

Surface of Revolution

"NURBSurf"

NURB surface

"TrimmedParametric"

Trimmed parametric surface

"ToroidalAsphere"

Toroidal Asphere surface

"XYToroidalAsphere"

XY Toroidal Asphere surface

"PolynomialAsphere"

Polynomial Asphere surface

"ZernikeSurf"

Zernike surface

"BiCubicMeshSurf"

Bi-cubic Mesh surface

"Coil"

Coil surface

"ScriptSurfImplicit"

Scripted surface

"Mirror"

Mirror element

"Singlet"

Lens element

"FNodeElement"

Custom element

"FNodeGeneralGeometry"

Subassembly

 

 

 

Example

The following script will loop over surfaces in the FRED document and list the NURB and Trimmed Parametric surfaces.

 

Sub Main

Dim ii As Long

Dim tString As String

'begin loop over entities

For ii = 0 to GetEntityCount()-1

'is the current entity a surface?

If IsSurface( ii ) Then

tString = GetType( ii )

'is the surface type a NURB or a Trimmed Parametric?

If StrComp( "NURBSurf", tString, 0 ) = 0 Or StrComp( "TrimmedParametric", tString, 0 ) = 0 Then

Print "Entity " & ii & " is a NURB type surface."

End If

End If

Next ii

End Sub

 

See Also

FindFullName

GetEntity

GetChild

GetParent

GetSibling

Entity Info Functions

 

 

 

 

 

Copyright © Photon Engineering, LLC