Customise SDNF
- Last UpdatedFeb 17, 2025
- 11 minute read
PML variables can be set to customize SDNF. They are set in the file called sdnfuserdata.pmlfnc found in the SDNF\dflts\user\SDNFPML\functions folder in the user data area of the interface.
The user modifiable function sdnfuserdata.pmlfnc is found in SDNF\dflts\user\SDNFPML.
If you customize the SDNF windows, you must reload the Model user interface from macros in order to rebuild it. If you change variables in the user data area, you can use the Re-initialize option on the main Import or Export windows.
Alternatively, you may reload the SDNF system variables and rebuild the windows using a command, after you have saved the sdnfuserdata.pmlfnc file:
call !!SDNFImpExp( )
However, if you find that the user interface windows are damaged, reload the Model UI from macros. A typical message indicating this condition might be:
Object does not have a member .targetlist
Note:
You must also load the Model UI from macros if you make any changes to the internal
mapping files
External Packages
If you use other external packages that can export and import SDNF files, you can extend the list of external packages which the interface knows about by modifying two list attributes:
!!SDNFExtProgList
!!SDNFExtProgAbbr
These lists must be kept in step with each other, as they match the names of the external packages with their three-letter abbreviations used internally in the interface. They may represent steel detailing packages, or the name on an intermediate mapping state, for example, SDNF, or even the mapping for a particular steel manufacturer. It is this three-letter abbreviation which is used in the identification of the correct mapping files. Note that ANY should be the last entry in the abbreviation list.
!!SDNFExtProgList.append( |XSteel| )
!!SDNFExtProgList.append( |AVEVA| )
and
!!SDNFExtProgAbbr.append( |XST| )
!!SDNFExtProgAbbr.append( |AVE| )
-- ANY to be the last in the list
!!SDNFExtProgAbbr.append( |ANY| )
The list is picked up automatically by the Import and Export windows. Thus, if you want to extend or modify the list of Target Packages, you need only to change it here, and not in the definition files. You must also generate the other internal and external mapping files required by the new system.
External Package Equivalences
When exporting to SDNF, the exporting program includes an identifying string in the SDNF file header. OpenSteel searches for this string in order to identify the source and then select the correct mapping files automatically.
Like the application, external packages can change their names over the years. The identifying string can also change, yet the program can still behave in a similar way to before. Therefore we need to be able to associate alternative identifying strings to the same basic source program. The associations are stored in the file sdnfuserdata.pmlfnc.
The example displays the code to make an equivalence relationship between the old program and new program. To create a new pairing, copy the bottom commented lines and replace the bold text accordingly.
-- Program equivalent list
!!sdnfExtProgEquList.delete( )
handle( 2,751 )
-- Variable does not exist
endhandle
!!sdnfExtProgEquList = ARRAY( )
-- Make NewProgram equivalent to OldProgram
-- The first entry is the one we DO have the mapping files for
!equivalent = ARRAY( )
!equivalent.append( |OldProgram| )
!equivalent.append( |NewProgram| )
!!sdnfExtProgEquList.append( !equivalent )
-- for further equivalents use versions of the next 4 lines
-- !equivalent.clear( )
-- !equivalent.append( |Existing program for which we have the mapping files| )
-- !equivalent.append( |New program to use the mapping files for the program above| )
-- !!sdnfExtProgEquList.append( !equivalent )
Once the relationship has been set up, OpenSteel treats SDNF files containing the string "NewProgram" as though they have come from "OldProgram" and uses the correct mapping files for OldProgram.
Colour Code
You can change the colours of the objects on the screen using variables. If you want to change them, the list of colour numbers is given in Model Reference. The default settings are:
!!SDNFColChanged = ( 12 ) $* Mauve
!!SDNFColAdded = ( 5 ) $* Green
!!SDNFColDuplicate = ( 6 ) $* Cyan
!!SDNFColDeleted = ( 2 ) $* Red
!!SDNFColExported = ( 3 ) $* Orange
!!SDNFColDefault = ( 1 ) $* Grey
The duplicate colour is used when the import system searches for items with duplicated mark numbers.
Tolerance Settings
You can modify the distance tolerance (the separation, in millimeters, below which two points are considered coincident), the minimum Plate thickness, and the minimum length of Linear Members. The minimum tolerance is used as a fine tolerance value in vector comparisons, such as for angles.
-- Set distance tolerance
!!SDNFDistTol = ( 1 )
!!SDNFMinTol = ( 0.01 )
Waiting Time
The system wait time represents the amount of time that the interface waits while the external program is executing. If there is no response within this time, the interface may assume that the external program has stopped for some reason. However, this may not be the case - it may just be working hard! You are be asked whether you want to wait for another unit period. The variable is nominally measured in seconds, but it is also dependent on how busy the computer is on other tasks as well.
-- Set wait time
!!SDNFWaitTime = ( 5 )
!!SDNFNoOfTries = ( 5 )
There is also a variable, !!SDNFNoOfTries, which is used to determine how many iterations of the waiting loop the interface goes through before prompting you for further information.
Export Header
The default Export file header information is to be contained in the Configuration SITE element. Header information can also be stored in ZONE and STRU elements. You can therefore create elements to store information specific to a particular Export event and use this information in the Export process. The variable indicates where that is. The default is set up by the system, but you may want to override that setting using code.
-- Source of Export Header data
!!SDNFExpHeader = !!SDNFConfigObj
The syntax must be set to a string representing the name of the SITE from which the configuration details are to be taken, for example,.
!!SDNFExpHeader = |/OtherHeaderSITE|
You still have the opportunity to choose the another header element during the Export process; this variable just sets up a default location.
The header element contains information about the imported or exported model, the client information, target information about the steel contractor and other details. The information can be customized per run by the creation of Sites, Zones or Structures and their selection as required.
Connected Members
You may set the default to ignore unconnected members. Alternatively, you may set the value to ‘true’ so that you do not Export unconnected members. if you want to ignore unconnected Linear Members, you receive a warning in the log file if any are found, otherwise an error is raised.
-- Ignore unconnected Linear members
!!SDNFNoUnconnMem = false
Ignore Material Flag
You can choose to ignore any errors caused by different material mappings by using this flag. What this means is that on comparing the original model with the imported model, any difference in material is not raised as an error.
-- Ignore Material changes
!!SDNFIgnoreMatl = false
External Mapping File Separator
The separator character for the external mapping files may be either a space or a comma. Using variables, you can indicate your choice.
All the files of the same type (either Material, Orientation or Profile) must use the same separator consistently: you cannot have some Material files space separated, while others are comma separated.
There is a third file format for Profile mapping files. The BLOCK format is described elsewhere and is indicated here with !!sdnfBlockSep. Block formatted files are pre-processed by a separate tool for more efficient reading and parsing.
-- Mapping File separators
!!SDNFProfSep = !!SDNFSpaceSep
!!SDNFMatSep = !!SDNFCommaSep
!!SDNFOriSep = !!SDNFSpaceSep
Pre- and Post-processing Macros
You can write your own macros to be run before and after either the Export or Import process has taken place. The macros allow you to build a model in Model which then needs some sort of pre- or post-processing, using variables.
-- Pre/Post Export User Defined Macros
!!SDNFPreExpMac = |preexport|
!!SDNFPostExpMac = |postexport|
The syntax defines the names of two macros which are to be found in the folder structure below the %PMLLIB% environment variable. They are named preexport.pmlfnc and postexport.pmlfnc, respectively.
These macros are called before and after the Export process has been executed. These macros should have no arguments and return no value.
Note:
You must handle all internal errors within the macros. Errors that are not handled
can cause the transfer process to crash.
User-definable Material Macro
If the material information is not contained in the MATR or :SDNFMGRADE attributes, it may be extracted from the database using a user-definable macro. The macro is identified using a global variable:
-- Material macro
!!SDNFMaterialMac = |sdnfgetusermatl|
The variable enables you to configure the system to extract material information in a manner different from the default system.
The reference to a macro is defined which is to be found in the folder structure below the %PMLLIB% environment variable. The macro takes no arguments and returns a string.
You must handle all internal errors within the macro.
Maximum File Size
For reading many files, such as the mapping files, log files or even some internal files, there is a current size limit of 500000 lines. The limit can be modified. For example:
-- Maximum file size in lines
!!sdnfMaxFileSize = ( 500000 )
Note:
This is not the size of the input model file. It is the estimated size of the internal
macro file produced during the translation process.
Profile Mapping Files
You can create your own Profile mapping files using either the application Specification Component or the Catalogue Component. The decision is fairly significant and must be made before starting to build the mapping files, as all of the profile mapping files must be built using one reference or the other. You cannot mix the application names.
Note:
The supplied files are based on the Catalogue Component names.
In the sdnfuserdata.pmlfnc function there is a variable, !!SDNFProfMapRef, which you can set to determine whether SDNF uses the Specification or Catalogue Component. By default the lines are as the example, with the second line commented out:
-- Profile Map Table Ref
!!SDNFProfMapRef = |CATR|
-- !!SDNFProfMapRef = |SPRE|
Should you want to build your Profile mapping files using the Specification Component, comment out the first line and uncomment the second, thus:
-- Profile Map Table Ref
-- !!SDNFProfMapRef = |CATR|
!!SDNFProfMapRef = |SPRE|
Refer to External Mapping Files - Profile Mapping Files for more information on profile mapping file structure.
Replacement of SCTNs with GENSECs on Import
The structural user interface creates GENSEC elements for all structural members, whether they are straight or curved.
In the first phase of import, all structural members are imported as GENSEC.
If you are importing to update an existing model, the database type of elements is not changed. If you merge into a member that was previously a SCTN, it will remain as one
SDNF File Headers
You can select whether the SDNF file contains listings of all the mapping files or just the Packet count table. You can modify the !!sdnfBriefHdr variable in the sdnfuserdata.pmlfnc file. By default the SDNF files have brief headers, but if you want to include details of all the files used for the translation, the variable can be switched to 'false'.
-- Brief/Verbose SDNF file header
!!sdnfBriefHdr = true
Export Internal Reference Numbers
Some systems do not use unique mark numbers on elements and so it can be difficult to relate components when they are repeatedly imported. The application keeps a record of both the reference number (:SDNFMARK) and the external mark number (:SDNFEMARK). If, prior to export, the system detects that there are duplicate external mark numbers, it switches automatically to exporting the applications internal reference numbers instead. However, you may want to force the system to export the external reference numbers irrespective of the state of the external mark numbers. You can change the flag !!sdnfFEMarkMode.
-- Flag to export [INTERNAL|EXTERNAL] IDs.
-- Change only if you are sure of what you are doing.
!!sdnfEMarkMode = |EXTERNAL|
Local User Configuration
The file sdnfuserdata.pmlfnc can be modified by hand to provide a degree of customization. System variables are overwritten in sdnfsystemdata.pmlfnc.
Note:
The sdnfsystemdata.pmlfnc function must not be modified.
There is a third level of customization available that is accessible by a graphical user interface. The window has access to versions of all the variables in the sdnfuserdata.pmlfnc function, but does not modify that function at all. Therefore, at this point, you are working with a local set of configuration data.
The Configuration window is accessible from either the main Import or Export window using Control > Configure.

The System Configuration window has five tabs Run Parameters, Model Parameters, Display Colours, Environment Parameters and Macros. The detail of the attributes can be viewed. The windows do have some data validation, where appropriate.






By default, the system looks for a file SDNF Interface.xml in the AVEVA_DESIGN_USER area. If present, this file is accessed when this window, and even when the whole system, is initialized. If this file is not available, then the default values that are used are set in sdnfsystemdata.pmlfnc and subsequently overwritten by sdnfuserdata.pmlfnc. You can save the window settings to this default file using Control > Save. To save the settings to another file, use Control > Save as option.
To load any settings file other than the default one, use Control > Load. A file browser displays, allowing you to choose where to locate the new file.
To restore the main default settings at window initialization, just delete the SDNF Interface.xml file.
Reset resets the values using the normal window initialization process with the current variables and any saved SDNF Interface.xml file.
The Re-initialize option goes right back to the source variables in the system and user data and the default SDNF Interface.xml files.
OK transfers the window settings to the main Import/Export system for use in that session. On re-displaying the window any unsaved attributes are lost.
Rebuild complex GENSECs
As is described in Transfer of Curved Members, you can rebuild a complex member from its component straight and curved segments. The rebuild is dependent upon the member name or its components. Using the member names and their start and end positions, a GENSEC can be rebuilt. Unfortunately this may be a wrong assumption when members being imported share duplicate names or parts thereof. The problem can be compounded when the model is a nodal one.
You can turn off this feature for the automatic rebuilding of GENSECS by changing the default value of the flag !!sdnfrebuildgensec.
-- Flag to rebuild imported GENSECs if possible.
-- !!sdnfRebuildGensec = false
!!sdnfRebuildGensec = true