Documentation: - Add docs/06_PHYSICS/ with Zernike fundamentals and OPD method docs - Add docs/guides/CMA-ES_EXPLAINED.md optimization guide - Update CLAUDE.md and ATOMIZER_CONTEXT.md with current architecture - Update OP_01_CREATE_STUDY protocol Planning: - Add DYNAMIC_RESPONSE plans for random vibration/PSD support - Add OPTIMIZATION_ENGINE_MIGRATION_PLAN for code reorganization Insights System: - Update design_space, modal_analysis, stress_field, thermal_field insights - Improve error handling and data validation NX Journals: - Add analyze_wfe_zernike.py for Zernike WFE analysis - Add capture_study_images.py for automated screenshots - Add extract_expressions.py and introspect_part.py utilities - Add user_generated_journals/journal_top_view_image_taking.py Tests & Tools: - Add comprehensive Zernike OPD test suite - Add audit_v10 tests for WFE validation - Add tools for Pareto graphs and mirror data extraction - Add migrate_studies_to_topics.py utility Knowledge Base: - Initialize LAC (Learning Atomizer Core) with failure/success patterns Dashboard: - Update Setup.tsx and launch_dashboard.py - Add restart-dev.bat helper script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
56 lines
1.9 KiB
Python
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))
|