Updated the parser to work with actual NX .sim/.prt files which are
binary format (not XML) in NX 12+.
Key Changes:
- Added dual-mode parser: XML for test files, binary for real NX files
- Implemented string extraction from binary .sim files
- Updated solution detection to recognize Nastran SOL types
- Fixed expression extraction with proper NX format pattern:
#(Type [units]) name: value;
- Added multiple .prt file naming pattern support
- Added .fem file parsing for FEM information
Parser Capabilities:
- Extracts expressions from .prt files (binary parsing)
- Detects solution types (Linear Statics, Modal, etc.)
- Finds element types from .fem files
- Handles multiple file naming conventions
Validation with Real Files:
- Successfully parsed tests/Bracket_sim1.sim (6.2 MB binary file)
- Extracted 1 expression: tip_thickness = 20.0 mm
- Detected 18 solution types (including Nastran SOL codes)
- Works with both XML test files and binary production files
Technical Details:
- Binary files: latin-1 decoding + regex pattern matching
- Expression pattern: #(\w+\s*\[([^\]]*)\])\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*([-+]?\d*\.?\d+)
- Multiple .prt file search: exact match → base name → _i suffix
- FEM parsing: extracts mesh, materials, element types from .fem files
Next Steps:
- Refine solution filtering (reduce false positives)
- Add load/constraint extraction from .fem files
- Test with more complex models