Data Checker Example 1: Panel Boundary Check
- Last UpdatedNov 14, 2025
- 2 minute read
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 for bad definition of panel boundary vertices:
-- Zero length edge; Less than three vertices; Panel loop not found
------------------------------------------------------------------------
define function !!EdgeCheck(!PanelRef is DBREF, !Check is CHKDEFINITION ) is CHKRETURN
-- initialize Variables
!Result = object CHKRETURN()
!Result.Passed = true
!Result.Messages.clear()
-- Get panel loop element - error if it does not exist
!PloopRef = ( PLOOP 1 OF $!PanelRef )
Handle any
!Result.Passed = false
!Result.Messages.append('No Panel Loop Found')
return !Result
endhandle
-- get array of vertices belonging to the panel boundary
VAR !Vertices COLLECT ALL PAVE FOR $!PloopRef
!NumberOfVerts = !Vertices.size()
-- Check that there are at least three vertices
if(!Vertices.size() lt 3) then
!Result.Passed = false
!Result.Messages.append('Only ' & !Vertices.size() & ' Vertices')
return !Result
endif
-- Add first vertex to the end to close the loop
!Vertices.append(!Vertices[1])
-- Loop through vertices and check for zero length edge
do !IndexVerts to !NumberOfVerts
-- get address and position of this vertex and next vertex
!Vertex = !Vertices[!IndexVerts].dbref()
!NextVertex = !Vertices[!IndexVerts + 1].dbref()
!VertexPos = !Vertex.Pos
!NextVertexPos = !NextVertex.Pos
-- calculate distance between vertices & test for less than 0.01mm tolerance
VAR !Dist CONSTRUCT DIST $!VertexPos TO $!NextVertexPos
if(!Dist.real() lt 0.01mm) then
!Result.Passed = false
!Result.Messages.append('Zero length edge: Vertex ' & !IndexVerts.string())
skip
endif
enddo
-- Return Data
return !Result
endfunction
The following is a sample report generated by running the preceding panel boundary check:
Check Report File
Created By : M.Barlow
Date : 10 Oct 97
Checks Performed
Class : Steelwork
Group : Panels
[1] Check Panel Boundary
Summary of Checks
Elements passed all tests : 8
Elements failed on or more tests : 4
Total : 12
Elements that have passed all checks : 8
DEVTEST-C22001-P00001
DEVTEST-C22001-P00002
DEVTEST-C22001-P00003
DEVTEST-C22001-P00004
DEVTEST-C22001-P00005
DEVTEST-C22001-P00006
DEVTEST-C22001-P00007
DEVTEST-C22001-P00008
Elements that have failed one or more checks: 4
Element: PANEL 1 of FRMWORK /DEVTEST-C22001
Check Panel Boundary - No Panel Loop Found
Element: PANEL 2 of FRMWORK /DEVTEST-C22001
Check Panel Boundary - Only 1 Vertices
Element: PANEL 3 of FRMWORK /DEVTEST-C22001
Check Panel Boundary - Zero length edge: Vertex 2
Element: PANEL 8 of FRMWORK /DEVTEST-C22001
Check Panel Boundary - No Panel Loop Found
End of Check Report File