- Extract mass RIGHT AFTER geometry rebuild while part is work part
- Replace unreliable p173 expression lookup with MeasureManager
- Skip re-extraction if mass already captured during rebuild
- Relax displacement constraint to 20mm (DEC-HB-012, CEO approved)
Root cause: journal hardcoded M1_Blank for bracket, failed silently on Beam.prt
Fix by: NX Expert + Manager diagnosis
Bug 1 — Journal (solve_simulation.py simple workflow):
Expression lookup for p173 fails silently for derived/measurement
expressions, so _temp_mass.txt was never written. Added MeasureManager
fallback via extract_part_mass() (already used in assembly workflow).
Bug 2 — Extractor (extract_mass_from_expression.py):
Journal writes 'p173=<value>' format but extractor tried float() on
the whole content including 'p173='. Added key=value parsing.
Defense in depth — nx_interface.py:
Added stdout parsing fallback: if _temp_mass.txt still missing, parse
mass from journal output captured via solver.py stdout passthrough.
Files changed:
- optimization_engine/nx/solve_simulation.py — MeasureManager fallback
- optimization_engine/extractors/extract_mass_from_expression.py — key=value parse
- optimization_engine/nx/solver.py — include stdout in result dict
- projects/hydrotech-beam/studies/01_doe_landscape/nx_interface.py — stdout fallback
Tags: hydrotech-beam, mass-extraction
- Journal now extracts p173 mass expression and writes _temp_mass.txt
- history.get_study_summary() called before history.close()
- Optuna nan rejection: fallback to INFEASIBLE_MASS penalty
- pyNastran warning 'nx 2512 not supported' is harmless (reads fine)
Root cause: Path.absolute() on Windows does NOT resolve '..' components.
sim_file_path was reaching NX as '...\studies\01_doe_landscape\..\..\models\Beam_sim1.sim'
NX likely can't resolve referenced parts from a path with '..' in it.
Fixes:
- nx_interface.py: glob from self.model_dir (resolved) not model_dir (raw)
- solver.py: sim_file.resolve() instead of sim_file.absolute()
- solve_simulation.py: os.path.abspath(sim_file_path) at entry point
- Diagnostic logging still in place for next run
Need to see why Parts.Open returns None even from the master model folder.
Logs: basePart1 type/name/path, unloaded parts status, file existence checks.
- solve_simulation.py: FEM finder now excludes idealized parts, falls back to loading .fem
- solve_simulation.py: hole_count written as [Constant] not [MilliMeter] in .exp
- run_doe.py: dual logging to console + results/doe_run.log