Files
Atomizer/archive/nx_journals/list_expressions_simple.py
Anto01 a3f18dc377 chore: Project cleanup and Canvas UX improvements (Phase 7-9)
## Cleanup (v0.5.0)
- Delete 102+ orphaned MCP session temp files
- Remove build artifacts (htmlcov, dist, __pycache__)
- Archive superseded plan docs (RALPH_LOOP V2/V3, CANVAS V3, etc.)
- Move debug/analysis scripts from tests/ to tools/analysis/
- Archive redundant NX journals to archive/nx_journals/
- Archive monolithic PROTOCOL.md to docs/archive/
- Update .gitignore with missing patterns
- Clean old study files (optimization_log_old.txt, run_optimization_old.py)

## Canvas UX (Phases 7-9)
- Phase 7: Resizable panels with localStorage persistence
  - Left sidebar: 200-400px, Right panel: 280-600px
  - New useResizablePanel hook and ResizeHandle component
- Phase 8: Enable all palette items
  - All 8 node types now draggable
  - Singleton logic for model/solver/algorithm/surrogate
- Phase 9: Solver configuration
  - Add SolverEngine type (nxnastran, mscnastran, python, etc.)
  - Add NastranSolutionType (SOL101-SOL200)
  - Engine/solution dropdowns in config panel
  - Python script path support

## Documentation
- Update CHANGELOG.md with recent versions
- Update docs/00_INDEX.md
- Create examples/README.md
- Add docs/plans/CANVAS_UX_IMPROVEMENTS.md
2026-01-24 15:17:34 -05:00

56 lines
1.9 KiB
Python

"""Simple expression lister - writes to file regardless of print issues"""
import NXOpen
import os
import json
session = NXOpen.Session.GetSession()
output_lines = []
results = {'expressions': [], 'success': False}
try:
# Get all open parts and find M1_Blank
for part in session.Parts:
part_name = part.Name if hasattr(part, 'Name') else str(part)
if 'M1_Blank' in part_name and '_fem' not in part_name.lower() and '_i' not in part_name.lower():
output_lines.append(f"Found part: {part_name}")
for expr in part.Expressions:
try:
name = expr.Name
# Skip internal expressions (p0, p1, etc.)
if name.startswith('p') and len(name) > 1:
rest = name[1:].replace('.', '').replace('_', '')
if rest.isdigit():
continue
value = expr.Value
units = expr.Units.Name if expr.Units else ''
rhs = expr.RightHandSide if hasattr(expr, 'RightHandSide') else ''
results['expressions'].append({
'name': name,
'value': value,
'units': units,
'rhs': rhs
})
output_lines.append(f"{name}: {value} {units}")
except:
pass
results['success'] = True
break
except Exception as e:
output_lines.append(f"Error: {str(e)}")
results['error'] = str(e)
# Write to file
output_path = r"C:\Users\antoi\Atomizer\_expressions_output.json"
with open(output_path, 'w') as f:
json.dump(results, f, indent=2)
# Also write text version
text_path = r"C:\Users\antoi\Atomizer\_expressions_output.txt"
with open(text_path, 'w') as f:
f.write('\n'.join(output_lines))