Data Checker Example 2: Structural Element Name Check
- Last UpdatedNov 14, 2025
- 2 minute read
This example checks the names of PANE, SCTN, FRMW and SBFR elements for primary steel ZONES (with FUNC ‘PS’). This example checks a panel boundary for zero length edges and missing vertices. The comments in the PML code describe the operations being performed.
------------------------------------------------------------------------
-- Description:
-- Checks that the first two letters of primary steel element names are
-- the same as the first two letters of the Production Number of that
-- ZONE. The Production Number is stored in UDA :PRODNO. A Zone containing
-- primary steel has its FUNC attribute set to 'PS'. Errors tested:
-- Production Number UDA not set
-- Production Number UDA incorrect (less than two letters)
-- Steelwork element not named
-- Name of <item full name> does not begin with <first 2 letters of :PRODNO>
------------------------------------------------------------------------
define function !!PSNameCheck (!ItemRef is DBREF, !Check is CHKDEFINITION ) is CHKRETURN
-- initialize Variables
!Result = object CHKRETURN()
!Result.Passed = true
!Result.Messages.clear()
-- Get Production Number and check that it is set
!ZoneRef = ( ZONE OF $!ItemRef )
!ProductionNumber = !ZoneRef.attribute(':PRODNO')
if ( !ProductionNumber.empty() ) then
!Result.Passed = false
!Result.Messages.append('Production Number not set for ' & !ZoneRef.flnn)
return !Result
endif
-- Check that production number has at least two characters
if ( !ProductionNumber.length() lt 2 ) then
!Result.Passed = false
!Result.Messages.append('Production Number incorrect for ' & !ZoneRef.flnn)
return !Result
endif
-- Get first two characters of the production number
!ProdCode = !ProductionNumber.substring(1,2)
-- Get name of steel element
!Name = !ItemRef.Name
-- Test for unset name - First character will be '='
if(!Name.substring(1,1) eq '=') then
!Result.Passed = false
!Result.Messages.append(!ItemRef.Type & ' not named ')
return !Result
endif
-- Test for first two letters of Production number = first two letters of name
if( !Name.substring(2,2) neq !ProdCode ) then
!Result.Passed = false
!Result.Messages.append( !ItemRef.Type & ' name does not begin with ' & !ProdCode )
endif
-- Return Data
return !Result
endfunction
The following is a sample report generated by running the preceding panel name check:
Check Report File
Created By : M.Barlow
Date : 9 Oct 97
Checks Performed
Class : Steelwork
Group : Administration
[1] Check Primary Steelwork Names
Summary of Checks
Elements passed all tests : 13
Elements failed one or more tests : 5
Total : 18
Elements that have passed all checks : 13
PA-C22001-P00002
PA-C22001-S00001
PA-C22001-P00003
PA-C22001-S00003
PA-C22001-S00004
PA-C22001-S00005
PA-C22001-S00006
PA-C22001-S00007
PA-C22001-S00008
PA-C22001-S00009
PA-C22001-P00005
PA-C22001-P00006
PA-C22001-P00007
Elements that have failed one or more checks: 5
Element: DEVTEST-C22001
Check Primary Steelwork Names - FRMW name does not begin with PA
Element: DEVTEST-C22001-P00001
Check Primary Steelwork Names - PANE name does not begin with PA
Element: DEVTEST-C22001-S00002
Check Primary Steelwork Names - SCTN name does not begin with PA
Element: DEVTEST-C22001-P00004
Check Primary Steelwork Names - PANE name does not begin with PA
Element: PANEL 5 of FRMWORK /DEVTEST-C22001
Check Primary Steelwork Names - PANE not named
End of Check Report File