Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Unified Engineering

Intelligent Text

  • Last UpdatedAug 13, 2025
  • 1 minute read

Intelligent text supports the calling of a global PML function (or a global string variable) as part of the intelligent text expression, using the "#PML" syntax. The PML function can take global parameters and must return a string.

---------------------------------------------------------------------

-- PML Function to calculate the number of rungs on a CWAY component

---------------------------------------------------------------------

define function !!getRungs(!component is DBREF) is STRING

-- Check for a valid component type

if (!component.type.neq('CTRAY')) then

-- Not a valid component type so provide suitable message

!string = 'Invalid Component Type'

else

-- Get component data

!owner = !component.owne

!catref = !component.catref

!rungSpacing = !catref.para[12]

-- For a straight piece of cable tray

if (!catref.gtype.eq('FTUB')) then

-- Read the start and the end of the straight piece

VAR !posPA POS PA OF $!owner

VAR !posPL POS PL OF $!owner

-- Turn the start and end points into position objects

!posPAObj = object POSITION(!posPA)

!posPLObj = object POSITION(!posPL)

-- Calculkate the length

!length = !posPAObj.distance(!posPLObj)

!numberOfRungs = !length / !rungSpacing

-- Build the output striung

!string = 'Number of rungs: ' & !numberOfRungs.int().value()

else

-- Every other component cannot be calculated yet

!string = 'Cannot Calculate'

endif

endif

return !string

endfunction

Related Links
TitleResults for “How to create a CRG?”Also Available in