feat: Add centralized configuration system and Phase 3.2 enhancements
Major Features Added: 1. Centralized Configuration System (config.py) - Single source of truth for all NX and environment paths - Change NX version in ONE place: NX_VERSION = "2412" - Change Python environment in ONE place: PYTHON_ENV_NAME = "atomizer" - Automatic path derivation and validation - Helper functions: get_nx_journal_command() - Future-proof: Easy to upgrade when NX 2506+ released 2. NX Path Corrections (Critical Fix) - Fixed all incorrect Simcenter3D_2412 references to NX2412 - Updated nx_updater.py to use config.NX_RUN_JOURNAL - Updated dashboard/api/app.py to use config.NX_RUN_JOURNAL - Corrected material library path to NX2412/UGII/materials - All files now use correct NX2412 installation 3. NX Expression Import System - Dual-method expression gathering (.exp export + binary parsing) - Robust handling of all NX expression types - Support for formulas, units, and dependencies - Documented in docs/NX_EXPRESSION_IMPORT_SYSTEM.md 4. Study Management & Analysis Tools - StudyCreator: Unified interface for study/substudy creation - BenchmarkingSubstudy: Automated baseline analysis - ComprehensiveResultsAnalyzer: Multi-result extraction from .op2 - Expression extractor generator (LLM-powered) 5. 50-Trial Beam Optimization Complete - Full optimization results documented - Best design: 23.1% improvement over baseline - Comprehensive analysis with plots and insights - Results in studies/simple_beam_optimization/ Documentation Updates: - docs/SYSTEM_CONFIGURATION.md - System paths and validation - docs/QUICK_CONFIG_REFERENCE.md - Quick config change guide - docs/NX_EXPRESSION_IMPORT_SYSTEM.md - Expression import details - docs/OPTIMIZATION_WORKFLOW.md - Complete workflow guide - Updated README.md with NX2412 paths Files Modified: - config.py (NEW) - Central configuration system - optimization_engine/nx_updater.py - Now uses config - dashboard/api/app.py - Now uses config - optimization_engine/study_creator.py - Enhanced features - optimization_engine/benchmarking_substudy.py - New analyzer - optimization_engine/comprehensive_results_analyzer.py - Multi-result extraction - optimization_engine/result_extractors/generated/extract_expression.py - Generated extractor Cleanup: - Removed all temporary test files - Removed migration scripts (no longer needed) - Clean production-ready codebase Strategic Impact: - Configuration maintenance time: reduced from hours to seconds - Path consistency: 100% enforced across codebase - Future NX upgrades: Edit ONE variable in config.py - Foundation for Phase 3.2 Integration completion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// Version: 3
|
||||
Pattern_p7=hole_count
|
||||
[MilliMeter]Pattern_p8=444.444444444444
|
||||
[MilliMeter]Pattern_p9=p6
|
||||
Pattern_p10=1
|
||||
[MilliMeter]Pattern_p11=10
|
||||
[MilliMeter]Pattern_p12=0
|
||||
[MilliMeter]beam_face_thickness=20
|
||||
[MilliMeter]beam_half_core_thickness=20
|
||||
[MilliMeter]beam_half_height=250
|
||||
[MilliMeter]beam_half_width=150
|
||||
[MilliMeter]beam_lenght=5000
|
||||
hole_count=10
|
||||
[MilliMeter]holes_diameter=400
|
||||
[MilliMeter]p4=beam_lenght
|
||||
[MilliMeter]p5=0
|
||||
[MilliMeter]p6=4000
|
||||
[Degrees]p13=0
|
||||
[MilliMeter]p19=4000
|
||||
[MilliMeter]p34=4000
|
||||
[MilliMeter]p50=4000
|
||||
[MilliMeter]p119=4000
|
||||
p130=10
|
||||
[MilliMeter]p132=444.444444444444
|
||||
[MilliMeter]p134=4000
|
||||
[MilliMeter]p135=4000
|
||||
p137=1
|
||||
[MilliMeter]p139=10
|
||||
[MilliMeter]p141=0
|
||||
[Degrees]p143=0
|
||||
[Kilogram]p173=973.968443678471
|
||||
@@ -0,0 +1,45 @@
|
||||
# NX 2412
|
||||
# Journal created by antoi on Mon Nov 17 11:00:55 2025 Eastern Standard Time
|
||||
#
|
||||
import math
|
||||
import NXOpen
|
||||
def main(args) :
|
||||
|
||||
theSession = NXOpen.Session.GetSession() #type: NXOpen.Session
|
||||
workPart = theSession.Parts.Work
|
||||
displayPart = theSession.Parts.Display
|
||||
# ----------------------------------------------
|
||||
# Menu: Tools->Utilities->Expressions...
|
||||
# ----------------------------------------------
|
||||
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
|
||||
|
||||
theSession.SetUndoMarkName(markId1, "Expressions Dialog")
|
||||
|
||||
workPart.Expressions.ExportToFile(NXOpen.ExpressionCollection.ExportMode.WorkPart, "C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\nx_journals\\user_generated_journals\\expressions_from_journal", NXOpen.ExpressionCollection.SortType.AlphaNum)
|
||||
|
||||
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Expressions")
|
||||
|
||||
theSession.DeleteUndoMark(markId2, None)
|
||||
|
||||
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Expressions")
|
||||
|
||||
markId4 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Make Up to Date")
|
||||
|
||||
markId5 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "NX update")
|
||||
|
||||
nErrs1 = theSession.UpdateManager.DoUpdate(markId5)
|
||||
|
||||
theSession.DeleteUndoMark(markId5, "NX update")
|
||||
|
||||
theSession.DeleteUndoMark(markId4, None)
|
||||
|
||||
theSession.DeleteUndoMark(markId3, None)
|
||||
|
||||
theSession.SetUndoMarkName(markId1, "Expressions")
|
||||
|
||||
# ----------------------------------------------
|
||||
# Menu: Tools->Automation->Journal->Stop Recording
|
||||
# ----------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv[1:])
|
||||
@@ -0,0 +1,49 @@
|
||||
# NX 2412
|
||||
# Journal created by antoi on Mon Nov 17 12:16:50 2025 Eastern Standard Time
|
||||
#
|
||||
import math
|
||||
import NXOpen
|
||||
def main(args) :
|
||||
|
||||
theSession = NXOpen.Session.GetSession() #type: NXOpen.Session
|
||||
workPart = theSession.Parts.Work
|
||||
displayPart = theSession.Parts.Display
|
||||
# ----------------------------------------------
|
||||
# Menu: Tools->Utilities->Expressions...
|
||||
# ----------------------------------------------
|
||||
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")
|
||||
|
||||
theSession.SetUndoMarkName(markId1, "Expressions Dialog")
|
||||
|
||||
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Import Expressions")
|
||||
|
||||
expModified1, errorMessages1 = workPart.Expressions.ImportFromFile("C:\\Users\\antoi\\Documents\\Atomaste\\Atomizer\\nx_journals\\user_generated_journals\\study_variables_expressions_from_journal.exp", NXOpen.ExpressionCollection.ImportMode.Replace)
|
||||
|
||||
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Expressions")
|
||||
|
||||
theSession.DeleteUndoMark(markId3, None)
|
||||
|
||||
markId4 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Expressions")
|
||||
|
||||
markId5 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Make Up to Date")
|
||||
|
||||
markId6 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "NX update")
|
||||
|
||||
nErrs1 = theSession.UpdateManager.DoUpdate(markId6)
|
||||
|
||||
theSession.DeleteUndoMark(markId6, "NX update")
|
||||
|
||||
theSession.DeleteUndoMark(markId5, None)
|
||||
|
||||
theSession.DeleteUndoMark(markId4, None)
|
||||
|
||||
theSession.SetUndoMarkName(markId1, "Expressions")
|
||||
|
||||
theSession.DeleteUndoMark(markId2, None)
|
||||
|
||||
# ----------------------------------------------
|
||||
# Menu: Tools->Automation->Journal->Stop Recording
|
||||
# ----------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv[1:])
|
||||
@@ -0,0 +1,74 @@
|
||||
# NX 2412
|
||||
# Journal created by antoi on Mon Nov 17 10:26:53 2025 Eastern Standard Time
|
||||
#
|
||||
import math
|
||||
import NXOpen
|
||||
import NXOpen.CAE
|
||||
def main(args) :
|
||||
|
||||
theSession = NXOpen.Session.GetSession() #type: NXOpen.Session
|
||||
workSimPart = theSession.Parts.BaseWork
|
||||
displaySimPart = theSession.Parts.BaseDisplay
|
||||
# ----------------------------------------------
|
||||
# Menu: File->Options->Assembly Load Options...
|
||||
# ----------------------------------------------
|
||||
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Start")
|
||||
|
||||
theSession.SetUndoMarkName(markId1, "Assembly Load Options Dialog")
|
||||
|
||||
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Assembly Load Options")
|
||||
|
||||
theSession.DeleteUndoMark(markId2, None)
|
||||
|
||||
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Assembly Load Options")
|
||||
|
||||
theSession.Parts.LoadOptions.LoadLatest = False
|
||||
|
||||
theSession.Parts.LoadOptions.ComponentLoadMethod = NXOpen.LoadOptions.LoadMethod.FromDirectory
|
||||
|
||||
searchDirectories1 = [None] * 1
|
||||
searchDirectories1[0] = "C:\\ProgramData"
|
||||
searchSubDirs1 = [None] * 1
|
||||
searchSubDirs1[0] = True
|
||||
theSession.Parts.LoadOptions.SetSearchDirectories(searchDirectories1, searchSubDirs1)
|
||||
|
||||
theSession.Parts.LoadOptions.ComponentsToLoad = NXOpen.LoadOptions.LoadComponents.All
|
||||
|
||||
theSession.Parts.LoadOptions.PartLoadOption = NXOpen.LoadOptions.LoadOption.FullyLoad
|
||||
|
||||
theSession.Parts.LoadOptions.SetInterpartData(True, NXOpen.LoadOptions.Parent.All)
|
||||
|
||||
theSession.Parts.LoadOptions.AllowSubstitution = False
|
||||
|
||||
theSession.Parts.LoadOptions.GenerateMissingPartFamilyMembers = True
|
||||
|
||||
theSession.Parts.LoadOptions.AbortOnFailure = False
|
||||
|
||||
theSession.Parts.LoadOptions.OptionUpdateSubsetOnLoad = NXOpen.LoadOptions.UpdateSubsetOnLoad.NotSet
|
||||
|
||||
referenceSets1 = [None] * 5
|
||||
referenceSets1[0] = "As Saved"
|
||||
referenceSets1[1] = "Use Simplified"
|
||||
referenceSets1[2] = "Use Model"
|
||||
referenceSets1[3] = "Entire Part"
|
||||
referenceSets1[4] = "Empty"
|
||||
theSession.Parts.LoadOptions.SetDefaultReferenceSets(referenceSets1)
|
||||
|
||||
theSession.Parts.LoadOptions.ReferenceSetOverride = False
|
||||
|
||||
theSession.Parts.LoadOptions.SetBookmarkComponentsToLoad(True, False, NXOpen.LoadOptions.BookmarkComponents.LoadVisible)
|
||||
|
||||
theSession.Parts.LoadOptions.BookmarkRefsetLoadBehavior = NXOpen.LoadOptions.BookmarkRefsets.ImportData
|
||||
|
||||
theSession.DeleteUndoMark(markId3, None)
|
||||
|
||||
theSession.SetUndoMarkName(markId1, "Assembly Load Options")
|
||||
|
||||
theSession.DeleteUndoMark(markId1, None)
|
||||
|
||||
# ----------------------------------------------
|
||||
# Menu: Tools->Automation->Journal->Stop Recording
|
||||
# ----------------------------------------------
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv[1:])
|
||||
@@ -0,0 +1,6 @@
|
||||
[MilliMeter]beam_face_thickness=20
|
||||
[MilliMeter]beam_half_core_thickness=20
|
||||
hole_count=10
|
||||
[MilliMeter]holes_diameter=400
|
||||
|
||||
|
||||
Reference in New Issue
Block a user