A Python utility for translating pipe layout files from CAESAR II (.NTXT format) to PIPESTRESS (.FRE format).
This tool converts piping system data exported from CAESAR II stress analysis software into a format readable by PIPESTRESS. It processes .NTXT files and generates .FRE files with appropriate PIPESTRESS cards for piping elements.
- Automatic File Detection: Scans the working directory for .NTXT files
- Interactive File Selection: Allows users to choose from multiple .NTXT files
- Comprehensive Element Support: Currently translates some piping elements including:
CROS
- Cross-sections/pipe propertiesTANG
- Tangent/straight pipe sectionsBRAD
- Bend radius definitionsVALV
- Valve componentsCRED
- Concentrated reducersERED
- Eccentric reducersSUPP
- Support pointsJUNC
- Junction pointsANCH
- Anchor points
- Logging: Detailed operation logging with timestamps
- Error Handling: Robust error handling for file operations
- Python 3.x
- pandas library
- os (built-in)
- datetime (built-in)
- Clone or download the repository
- Install required dependencies:
pip install pandas
- Place your .NTXT files in the same directory as
pipe-translator.py
- Run the script:
python pipe-translator.py
- If multiple .NTXT files are found, select the desired file when prompted
- The translated .FRE file will be generated as
output.FRE
- Fixed-width format exported from CAESAR II
- Contains element types: ELMT, REST, RIGD, BEND, RED
- Includes node information, displacements, and pipe properties
- PIPESTRESS-compatible format
- Organized into two sections:
- PROPERTIES: CROS cards defining pipe cross-sections
- PIPING: Element cards defining the piping layout
Base class providing common functionality:
- File system operations
- Logging capabilities
- Working directory management
Handles .NTXT file operations:
- File discovery and listing
- User file selection
- File parsing and dataframe creation
Manages PIPESTRESS file generation:
- Element translation logic
- PIPESTRESS card generation
- Output file writing
The translator processes elements in the following manner:
- ELMT (Elements): Converted to TANG cards with displacement and property data
- REST (Restraints): Converted to SUPP cards for support points
- RIGD (Rigid): Converted to VALV cards for valve components
- BEND (Bends): Converted to BRAD cards with radius information
- RED (Reducers): Converted to CRED or ERED cards based on displacement data
- Log File:
pipe-translator.log
- Contains detailed operation logs - Output File:
output.FRE
- PIPESTRESS-compatible piping data - Console Output: Real-time operation status and prompts
> Base class created...
> NtxtObj class created...
> PepsObj class created...
> output.FRE file created...
>>> .NTXT file [0] --> example_pipe
>>> Read file [0]
> output.FRE file cleared...
> Translation job started...
> Translation job finished...
> Writing .FRE file...
>>> 5 CROS cards created!
>>> 25 element cards created!
The application includes error handling for:
- File access issues
- Invalid file formats
- Missing data elements
- Index out of range errors
- The tool assumes node numbering starts from 10 (anchor point)
- Cross-section properties are automatically numbered starting from 100
- Junction cards are automatically cleaned up to prevent duplicates
- All output includes proper PIPESTRESS formatting and syntax
- Source Software: CAESAR II
- Target Software: PIPESTRESS
- File Formats: .NTXT (CAESAR II export) → .FRE (PIPESTRESS input)
- v1.0.0: First and current version
- Previous versions available in
/old
directory
See LICENSE.md file for licensing information.