Checker
Checker
:
Configuration
: Checker Examples
Checker Examples
Checking 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
-- Initialise 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
Checking 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
-- Initialise 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
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.