' Use dictionaries for materials and sections
Set materials = New Dictionary
Set sections = New Dictionary
' Populate materials
materials.Add "Steel", Array(200000000000#, 0.3, 7850, "Isotropic")
materials.Add "Concrete", Array(25000000000#, 0.2, 2400, "Isotropic")
materials.Add "Aluminum", Array(69000000000#, 0.33, 2700, "Isotropic")
materials.Add "CarbonFiber", Array(70000000000#, 0.28, 1600,
"Orthotropic")
' Populate sections
sections.Add "Rectangular", Array("Rectangular", 0.2, 0.3)
sections.Add "Circular", Array("Circular", 0.25)
sections.Add "I-Beam", Array("I-Beam", 0.2, 0.3, 0.02, 0.015)
sections.Add "Pipe", Array("Pipe", 0.25, 0.02)
' Set default analysis options
analysisType = "2D"
solverType = "direct"
deformationScale = 50
End Sub
Sub CreateEnhancedInputForm()
Dim frm As Object
Set frm = ThisWorkbook.VBProject.VBComponents.Add(vbext_ct_MSForm)
With frm
.Properties("Caption") = "Enhanced Structural Analysis"
.Properties("Width") = 800
.Properties("Height") = 650
End With
' Add enhanced controls
AddControl frm, "Frame", "fraMain", "", 10, 10, 770, 590
' Analysis options frame
AddControl frm, "Frame", "fraOptions", "Analysis Options", 520, 20, 250,
120)
AddControl frm, "Label", "lblAnalysisType", "Analysis Type:", 530, 50,
80, 20)
AddControl frm, "ComboBox", "cboAnalysisType", "", 620, 50, 140, 20)
AddControl frm, "Label", "lblSolver", "Solver:", 530, 80, 80, 20)
AddControl frm, "ComboBox", "cboSolver", "", 620, 80, 140, 20)
AddControl frm, "Label", "lblDefScale", "Deformation Scale:", 530, 110,
80, 20)
AddControl frm, "TextBox", "txtDefScale", "", 620, 110, 50, 20)
' Structure components frame
AddControl frm, "Frame", "fraComponents", "Structure Components", 20, 20,
480, 250)
AddControl frm, "CommandButton", "btnAddNode", "Add Node", 30, 50, 80,
25)
AddControl frm, "CommandButton", "btnAddElement", "Add Element", 120, 50,
80, 25)
AddControl frm, "CommandButton", "btnAddLoad", "Add Load", 210, 50, 80,
25)
P a g e 52 | 62