Basic Functions > Working with Files > 4.1 File Types and Formats
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
4.1 File Types and Formats
In Patran, all project-related information is stored in files of various types and formats. The following is a brief description of the major file types that are created or accessed during Patran operations:
Patran Database
This file contains the data that define your geometric and finite element model, as well as all analysis results. Databases are binary files that are automatically assigned a .db file name extension (e.g., test.db). This extension must remain with the file name.
Session File
A session file is a log of all database related commands and corresponding comments executed during a work session. A single session file may contain commands that were used for more than one database. Session files are given a .ses.xx filename extension, where xx is a number that shows the position of this session file in the sequential order of session files (e.g., test.ses.01= the first session file). MSC recommends that you maintain the.ses extension, although this is not a strict requirement.
Journal File
A journal file contains all database related commands executed while creating a specific model. A journal file spans all sessions required to complete a model. Journal files are assigned a .jou extension (e.g., test.db.jou).
Hardcopy File
A hardcopy file is a generic file named patran.hrd that is used as an intermediate step to creating an output file for specific print drivers, such as HP-GL and CGM.
Patran Neutral File
The Patran Neutral file is a specially formatted file that contains Patran 2.5 model information. The neutral file provides a means of importing and exporting model data.
IGES File
IGES (Initial Graphics Exchange Specification) files are ANSI standard formatted files that make it possible to exchange data among most commercial CAD systems.
Patran supports a fixed line length ASCII file format, where the entire file is partitioned into lines of 80 characters in length, beginning with the first character in the file.
Patran 2.5 Results Files
The three formats of Patran 2.5 results files that can be imported into Patran are:
Element results file (.els)
Nodal results file (.nod)
Displacement results file (.dis)
For more about importing Patran 2.5 Results Files, see Patran 2.5 Results Files, 46.
Startup Files
Patran relies on a set of required and optional external text files during the startup of a new session, as follows:
The settings.pcl file, 47 is used to define a default environment for the Patran session. The environment includes hardcopy parameter settings and operation of Patran’s 3D driver.
The p3prolog.pcl and p3epilog.pcl Files, 54 are used to customize and automate PCL capabilities within Patran, and to provide a way for customized forms and widgets to be created.
Startup Session Files, 54. There are a number of ways to customize automatic execution of user defined session files, or to specify the file name of a new session file to be written to by Patran with its startup session file feature.
For more information on these user defined customization files for Patran, continue onto the following sections.
The settings.pcl file
Patran searches for and reads a file called settings.pcl at the beginning of each session. The settings.pcl file contains parameter values which define the environment in which the session will be run.
The search for this file begins in the default directory first, then moves to the home directory, then finally to the delivery directory. If this file cannot be found, a new settings.pcl file will be created in the default directory with a set of default parameter values.
If an existing settings.pcl file is found which contains a missing parameter value, a default value will be assigned.
Many of the parameters may be changed during the Patran session using the available widgets and forms. To ensure the Patran environment defined during the session is maintained, the values in the settings.pcl file that were used at the start of the session will be added to or overwritten (unless the found settings.pcl file was write protected).
All of the entries in settings.pcl are written in PCL and most have calls to the PCL’s built-in functions. The parameters of interest to most users are presented below. The default values are in parentheses. For more information, please refer to File>Print (p. 225) in the Patran Reference Manual.
 
Integer variables set using pref_env_set_integer()
create_dup_geometry (3)
Controls the creation of duplicate geometry:
1 creates duplicate geometry automatically.
2 never creates duplicate geometry.
3 asks user for permission before creation.
graphics_colors (150)
Number of colors allocated in the colormap.
message_warning (3)
Warning message options include:
1 indicates that the message should be written to the history window.
2 indicates that a warning bell should also be rung.
3 indicates that a modal form should be displayed as well as writing the message to the history window.
Real variables set using pref_env_set_real()
hc_letter_ht (0.8)
(HPGL & HPGL/2 only)
VisibleHistoryItems (3)
Number of history lines to be displayed in the main form. Also can be controlled by dragging the main form border.
Logical variables set using pref_env_set_logical()
SmallScreen1Layout (False)
True causes Patran initial menu/viewport configuration to be automatically sized for small monitor screens. Avoids truncation of certain Patran forms.
ApplSwitchIsPopup (False)
True causes the application switches to be removed from the main form and displayed as a popup menu. This is also controlled by the Preferences Forms... pulldown form.
Show_cycle_picking_form (True)
True causes the cycle picking form to be displayed. This is also controlled from the Preferences Forms...form.
Show_Icon_Help (True)
True causes the popup help to be displayed when the cursor is placed on an icon.
Save_Vis_History_Item_
Count (True)
True causes the number of displayed history lines to be saved between sessions.
String variables set using pref_env_set_string()
graphics_fullcolor (“NO”)
Full color mode or lookup mode. Options include “YES” and NO”. “YES” will use full-color color processing techniques. “NO” will use lookup or color table color processing techniques.
graphics_hardware (“NO”)
Hardware graphics device or software graphics device. Options include “YES” and “NO.” “YES” will use the local graphics system of the host. “NO” will use the software graphics device, X Windows.
graphics_refresh (“NO”)
Automatically refresh exposed areas of the viewport on machines without backing store.
p3team_graphics_
hardware (“NO”)
Graphics device for the Patran TEAM application. Options include “YES” and “NO.” “YES” will use the local graphics system of the host. “NO” will use the software graphics device, X Windows.
entity_picking_
cursor (holeangle)
Selects the shape of the cursor when in entity picking mode. Controlled by the Preferences Picking... form. Options include “holeangle”, “+hole”, “xhole”, “+” and “x”.
select_menu_layout (vertical)
Selects the orientation of the select menu from either vertical or horizontal. Horizontal selection is ignored if select menu is used as a popup, below. Options include “vertical” and “horizontal.”
select_menu_type (form)
Selects whether the select menu automatically appears as a form or is controlled as a popup by assigning to a key (Key must be selected using the Preferences Key Map form). Options include “form” and “popup”.
String variables set using pref_env_set_string()
"ResTmplAutoLoadDirOrder","1,3,2,4"
 
This parameter alters the top directory search order when looking for Results Templates to Auto load in a database. The default order is “1,2,3,4.” Permutations of the integers permute the directory hierachical search order. The default order is none, ., $HOME, and $P3_HOME. Thus, the above example will cause $HOME to be searched before the current directory (.).
"result_capture_filename","patran.prt"
This settings parameter sets the default report filename used in the Results application when writing reports
"result_quick_avg_domain", "All"
All is the default that is used if nothing is set, or if invalid values are given. Valid values are: All, Material, Property, EType, Target, Element
"result_quick_extrap_method", "ShapeFunc"
ShapeFunc is the default that is used if nothing is set, or if invalid values are given. ShapeFunc, Average, Centroid, Max, Min, AsIs.
"result_quick_transform", "Default" 
This settings parameter sets the default coordinate transformation method for Quick Plots in the Results application. Valid values are: Default, Global, CID, ProjectedCID, None, Material, ElementIJK
"result_quick_avg_method","DeriveAverage"
This settings parameter sets the default averaging method for Quick Plots in the Results application. Valid values are: DeriveAverage, AverageDerive, Difference, Sum
“NastranResultsOutput”,”XDB Only”
This parameter sets the default results output type for the MD Nastran preference. The default is “XDB and Print” if this parameter is not specified. Valid values are:
XDB Only
XDB and Print
OP2 Only
OP2 and Print
Print Only
None
Logical variables set using pref_env_set_logical()
"ResTmplAutoLoadNewDb", TRUE
Enables the automatic loading of Results Templates for new databases. Setting this parameter to FALSE disables the automatic loading and is the default.
"ResTmplAutoLoadOpenDb", TRUE
Enables the automatic loading of Results Templates when opening existing databases. Setting this parameter to FALSE disables the automatic loading and is the default.
"ResTmplAutoLoadAllFiles", TRUE
Finds all matches when searching for the Results Template initialization session file. Setting this parameter to FALSE causes the usual pattern of behavior of stopping when the first matching file is found in the directory search hierarchy. FALSE is the default.
"result_dbopen_display", TRUE
Any posted result plots displayed when a database is closed are redisplayed when reopened. This is the default. If plots are not to be displayed run a database is opened, then set this parameter to FALSE.
“Use_Pref_Elem_Test", def_value
Logical variable designed for utilizing MD Nastran element checks from within Patran.
If this variable is set to TRUE, some of the Finite Element Verification functions will be the exact check that is run by MD Nastran. This will be indicated by the different icon.
 
Integer variables set using pref_env_set_integer()
"result_loadcase_abbreviate", 10
Result Case names, when multiple subcases (time steps, load steps, etc.) exist, are displayed in an abbreviated form if there are more than the specified number of subcases. This condenses the number of Result Case items displayed in listboxes in the Results application.
"prop_form_full_refresh_limit", n_prop_limit 
If the number of properties in the database exceeds n_prop_limit, the following form behavior changes will occur:
Newly created properties will be added to the bottom of the listbox. The listbox position will not change.
Renamed properties will replace the old property at the same position in the listbox regardless of the sort and filter settings.
To force a refresh of the listbox, the filter button may be used.
Properties are not re-read from the database and the property listbox is not refreshed each time the Property/Create or Property/Modify form is opened. All of the standard methods ( elementprops_create(), elementprops_modify(), elementprops_delete(), elementprops_expand(), elementprops_compress() ) for modifying properties on the database will cause a signal to re-read the database and refresh the listbox if they are performed while the properties form is closed. However, any direct db calls to modify properties will not. Therefore, if direct db type of operations are performed, the property form will become out of sync with the database. To re-sync, the database must be closed and reopened. Also, switching the Property form Action to Delete, Compress or Expand and then back to Create or Modify triggers a database re-read. This same behavior occurs in V2001.
Opening the Property/Delete or Compress forms causes a listbox refresh the next time the Property/Create or Modify form is opened. Otherwise switching between Property/Create or Property/Modify forms is fast.
Creating or Modifying properties from a session file (command line) will cause a listbox refresh the next time the Property/Create or Property/Modify form is opened.
Preference Environment Variables for Hardcopy
The following is a table of preference environment variables displayed in settings.pcl. The environment variables are used with the Patran hardcopy drivers: PostScript, HPGL and HPGL/2. These variables can be modified in a number of ways in Patran:
They are displayed as widgets on the hardcopy forms. Please refer to File>Print, 225 for information on how to access these forms in Patran.
They are displayed in the settings.pcl file, which can be modified with any text editor.
They are also read as environment variables. These hardcopy environment variables may be modified using the UNIX setenv command or the Windows NT set command.
The following is a table of all hardcopy variables defined in Patran. Further explanation of the variable values can be found in File>Print, 225:
Other Preference Environment Variables
 
Description
Preference Name
Environment Variable Name
Default
Possible Values
Duplicate geometry creation control
create_dup_bord
ered
P3_CREATE_DUP_GEOMETRY
3
1
2
3
The p3prolog.pcl and p3epilog.pcl Files
The files p3prolog.pcl and p3epilog.pcl are read during the initialization of Patran. The p3prolog.pcl file allows the user to predefine PCL variables and to pre-compile PCL files or functions. The p3epilog.pcl file is used to create user defined or customized widgets.
The p3prolog.pcl and p3epilog.pcl files may be added to the default directory (where Patran will be executed from), or to the home or login directory.
The p3prolog.pcl file is one of the first PCL files to be read by the Patran system during startup. While it is a standard PCL file, the PCL entries contained in this file should not reference any of the standard built-in PCL functions since Patran has not yet been initialized when this file is read.
The p3epilog.pcl file is one of the last PCL files to be read by the Patran system during startup. Since most PCL applications have been initialized by the time this file is read, PCL calls may, in general, include PCL application calls. The p3epilog.pcl file would contain PCL calls that create user defined forms and widgets.
For an example of how p3epilog.pcl is used to create customized widgets, please refer to Example: Creating a Simple Customized Menu and Form (p. 293) in the PCL and Customization.
Startup Session Files
During the startup of Patran, you may define a default play and record session file. The session file user interface consists of three different levels of interfaces where each level can supersede the previous one. These interfaces are made up of the system start-up file interface, the command line interface (both of which are described here) and the session file forms. See File>Session, 223 interface.
Startup using system files
Patran allows start-up files to control its initialization. In addition to other start-up and PCL commands, the following two lines may be included:
sf_record_default( STRING init_rec_file, LOGICAL record_rotations)
sf_play_default( STRING init_play_file, LOGICAL single_step)
These commands should only be placed in p3epilog.pcl. These commands select the initial files and option modes. If these lines are not present, there is no default play file, “md_patran.ses” will be the default record file (unless overridden later) and both options default to FALSE.
Recording session file initialization
The first line (sf_record_default) initializes the recording session file and form. The default recording file (<init_record_file>) can either indicate no file to suppress the default file (e.g., specify an empty string: “ ”), specify the file from its base name only (e.g., “md_patran” will use “md_patran.ses.xx”) or specify a base name and an extension (e.g., “new.ext” will use “new.ext.xx”). The <record_rotations> flag must be set to TRUE if rotation events are to be written to the session file.
Playing session file initialization
The second line (sf_play_default) initializes the playing session file and form. The default playing file (<init_play_file>) can either indicate no file, specify a file name as above or specify a file with extension and version (e.g. “temp.ses.01”). It is highly recommended that either the no file or file.extension.version form be used. Using one of the other forms may conflict with the current recording session file name--usually resulting in an empty file being erroneously played. The <single-step> flag must be set to TRUE if the user desires to view and/or modify each played line.
Startup from command line
Patran also allows you to specify a playback file and/or a record file on the command line. The UNIX command line options are “-sfp <filename>” (session file play) and “-sfr <file name>” (session file record). The use of these options supersedes their previous values as specified in the system files (see above). Specifying either of these options with no file name cancels any default files called out by the system files.
The example below would suppress the recording session file and play test.ses.03.
  p3 -sfr -sfp test.ses.03 
The Template Database File (md_template.db)
As documented in Basic Functions, new Patran databases are not empty. When a new database is created, a md_template.db file is copied from the Patran delivery directory into the default directory, and is used as the new database file.
The md_template.db file contains specific analysis code definitions for all Patran Application Preferences and Modules (e.g., MD Nastran, MSC.Marc, etc.). Thus, when constructing a model, users have available the choices of accessing a specific set of any supported analysis code definitions within the md_template.db.
However, the md_template.db file may be customized for specific material and element definitions, as well as customizing for only those Patran Application Preferences or Modules that you are licensed to run.
For example, if your site has a set of materials that is more extensive than the standard set of materials, you can add the specific material information to the template database. This would ensure that all subsequent Patran databases created would reference the customized md_template.db file, and it would contain the additional material definitions.
Similarly, specific element types can be removed from the standard Patran element library in the template database, and the removed element types would not appear for users that reference the modified md_template.db file during the creation of the new database.
Refer to the Patran Reference Manual for more information on configuring the md_template.db file.