User Defined Functions
- Last UpdatedJan 13, 2026
- 2 minute read
In addition to the standard expression functionality, it is also possible to create a user defined function to perform more advanced checking.
The administrator can assign a user defined check function to the Criteria fields. The value in the expression field is the full function call to the user defined function. For example, the expression could be called !!checkCriteria1().

User Defined Check Function - Creation and Usage Rules
The following rules must be observed when assigning a function:
-
The function entered in the expression field must be in the correct format. For example, !!functionName()
-
The user defined function file must have a BOOLEAN return type. For example, the function file definition must in the following format:
Define function !!functionName() is BOOLEAN
-
The function cannot be called with any arguments. For example, the function brackets must be empty.
-
When the user defined check function is run, the current element will be the datum atta of the pipe so all processing must be done on this basis. For example, to interrogate the branch the following command is used.
!bran = !!ce.owner
User Defined Check Function - Example Listing
The example user defined check function enables the user to create a support only when the paint spec of the branch is either '12345-STD-PIP-001-RAL1069' or '12345-STD-PIP-001-RAL1070'.
define function !!checkCriteria1() is BOOLEAN
--get the paint spec of the pipe branch
var !paintSpec ptsp of bran
--make sure that the paint spec of the of the pipe is one of the types specified below
if !paintSpec.neq('12345-STD-PIP-001-RAL1069') and !paintSpec.neq('12345-STD-PIP-001-RAL1070') then
return FALSE
else
return TRUE
endif
endfunction
The user defined check function must be created in a standard text file. As the function name is checkCriteria1 the file should be saved as checkcriteria1.pmlfnc
It is recommended that check functions are saved in a separate folder to PDMS and that the pmllib environment variable in PDMS startup is modified to point to it.
For example:
-
Create a folder called pmllib in c:\userpml\
-
Save checkcriteria1.pmlfnc to c:\userpml\pmllib\
-
Modify the environment variable for pmllib to add this new search path. For example:
set pmllib= c:\userpml\pmllib;%PMLLIB%
-
Enter Design, type PML REHASH ALL into the command line and press enter. The pml index is updated allowing the user defined file to be used.
See the Software Customization Guide for further information regarding PML customization.