SAP2000API代码-挡土墙
更新时间:2023-10-13 01:14:01 阅读量: 综合文库 文档下载
- sap2000APi函数推荐度:
- 相关推荐
'FormWall1D Code
Imports System.Math
Public Class FromWall1D
Dim TimeSum As Integer = 0 Dim i, j, k As Integer Dim ret As Long
Dim ModelName As String
Dim AboutBoxFlag As Boolean = False
'点击一次即弹出ComboBox下拉菜单
Private Sub DataGridView_CellEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView.CellEnter Dim dgv As DataGridView = CType(sender, DataGridView)
If dgv.Columns(e.ColumnIndex).Name = \ Or dgv.Columns(e.ColumnIndex).Name = \ Then SendKeys.Send(\) End If End Sub
'初始化程序
Public Sub New()
'此调用是Windows 窗体设计器所必需的。 InitializeComponent()
'在InitializeComponent() 调用之后添加任何初始化。
'初始化Datagridview
Me.DataGridView.AllowUserToAddRows = False
Me.DataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill Me.DataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing Me.DataGridView.ColumnHeadersHeight = 20
'初始化地下室楼层总数为
Me.ComboBoxStoryNum.SelectedIndex = 0
'初始化标准高度为
Me.ComboBoxStoryHeight.Text = \
'初始化标准墙厚为
Me.ComboBoxWallThickness.Text = \
'初始化标准保护层厚度为
Me.ComboBoxConcreteCover.Text = \
'初始化标准混凝土等级为C30
Me.ComboBoxConcreteGrade.SelectedIndex = 1
'初始化标准钢筋等级为HRB400
Me.ComboBoxRebarClass.SelectedIndex = 2
'初始化地下水距墙顶高差为
Me.ComboBoxWaterLevel.Text = \
'初始化场地距墙顶高差为
Me.ComboBoxSiteLevel.Text = \
'初始化土容重为
Me.ComboBoxSoilUintWeight.Text = \
'初始化土浮容重为
Me.ComboBoxSoilMergedUnitWeight.Text = \
'初始化地面堆载为
Me.ComboBoxGroundLoad.Text = \
'初始化土内摩擦角为
Me.ComboBoxInternalFrictionalAngle.Text = \
'初始化土压力类型为静止土压力
Me.ComboBoxCalMethod.SelectedIndex = 0
'初始化静止土压力折减系数为.0
Me.ComboBoxPressureReduce.Text = \
'初始化墙顶约束为铰接
Me.ComboBoxRestraintTop.SelectedIndex = 1
'初始化墙低约束为刚接
Me.ComboBoxRestraintBottom.SelectedIndex = 1
'初始化标题列宽度不能改变
Me.DataGridView.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing Me.DataGridView.RowHeadersWidth = 25
'初始化标题行高度不能改变
Me.DataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing Me.DataGridView.ColumnHeadersHeight = 25
End Sub
'楼层数赋值并调整DataGridView行数
Private Sub ComboBoxStoryNum_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBoxStoryNum.SelectedIndexChanged Me.DataGridView.RowCount = ComboBoxStoryNum.Text
For i = 0 To Me.DataGridView.RowCount - 1
Me.DataGridView(0, i).Value = -1 * i - 1 & \
If Me.DataGridView(1, i).Value = \ Then
Me.DataGridView(1, i).Value = Me.ComboBoxStoryHeight.Text End If
If Me.DataGridView(2, i).Value = \ Then
Me.DataGridView(2, i).Value = Me.ComboBoxWallThickness.Text End If
If Me.DataGridView(3, i).Value = \ Then
Me.DataGridView(3, i).Value = Me.ComboBoxConcreteCover.Text End If
If Me.DataGridView(4, i).Value = \ Then
Me.DataGridView(4, i).Value = Me.ComboBoxConcreteGrade.Text End If
If Me.DataGridView(5, i).Value = \ Then
Me.DataGridView(5, i).Value = Me.ComboBoxRebarClass.Text End If Next End Sub
'层高赋值 Private Sub ComboBoxStoryHeight_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBoxStoryHeight.TextChanged
For i = 0 To Me.DataGridView.RowCount - 1
Me.DataGridView(1, i).Value = Me.ComboBoxStoryHeight.Text Next End Sub
'墙厚赋值
Private Sub ComboBoxWallThickness_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBoxWallThickness.TextChanged For i = 0 To Me.DataGridView.RowCount - 1
Me.DataGridView(2, i).Value = Me.ComboBoxWallThickness.Text Next End Sub
'保护层厚度赋值
Private Sub ComboBoxConcreteCover_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBoxConcreteCover.TextChanged For i = 0 To Me.DataGridView.RowCount - 1
Me.DataGridView(3, i).Value = Me.ComboBoxConcreteCover.Text Next End Sub
'混凝土等级赋值
Private Sub ComboBoxConcreteGrade_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBoxConcreteGrade.SelectedIndexChanged For i = 0 To Me.DataGridView.RowCount - 1
Me.DataGridView(4, i).Value = Me.ComboBoxConcreteGrade.Text Next End Sub
'钢筋等级赋值
Private Sub ComboBoxRebarClass_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBoxRebarClass.SelectedIndexChanged For i = 0 To Me.DataGridView.RowCount - 1
Me.DataGridView(5, i).Value = Me.ComboBoxRebarClass.Text Next
End Sub
'根据土压力计算类型不同调整土压力折减系数对话框有效性
Private Sub ComboBoxCalMethod_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxCalMethod.SelectedIndexChanged If Me.ComboBoxCalMethod.SelectedIndex = 0 Then Me.LabelPressureReduce.Enabled = True Me.ComboBoxPressureReduce.Enabled = True Else
Me.LabelPressureReduce.Enabled = False
Me.ComboBoxPressureReduce.SelectedIndex = 1 Me.ComboBoxPressureReduce.Enabled = False End If End Sub
Private Sub ButtonOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOK.Click
'当数据文件路径为空时
If Me.TextBoxFilePath.Text = \ Then If Not FileSave(Me) Then Exit Sub Else
If GetFileString(Me) <> GetFileString(Me.TextBoxFilePath.Text) Then Dim MsgVal
MsgVal = MsgBox(\当前数据与\ & Me.TextBoxFilePath.Text & \数据不同,是否覆盖源文件?\, MsgBoxStyle.YesNoCancel, \提示\) Select Case MsgVal
Case 6 '选择Yes,覆盖源文件
If Not FileSave(Me, Me.TextBoxFilePath.Text) Then Exit Sub Case 7 '选择No,另存新文件
If Not FileSave(Me) Then Exit Sub Case 2 '选择Cancel,返回编辑 Exit Sub End Select End If End If
'当模型路径为空时
If Me.TextBoxModelPath.Text = \ Then
SaveFileDialog.Filter = (\)
SaveFileDialog.Title = \保存SAP2000模型文件(*.sdb)\
If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK And Len(SaveFileDialog.FileName) > 0 Then
ModelName = SaveFileDialog.FileName()
Me.TextBoxModelPath.Text = SaveFileDialog.FileName() Else
Exit Sub End If Else
ModelName = Me.TextBoxModelPath.Text End If
'定义SAP2000变量
Dim SAPObject As SAP2000v15.SapObject Dim SAPModel As SAP2000v15.cSapModel
'定义层数并赋值
Dim StoryNum As Integer
StoryNum = Val(Me.ComboBoxStoryNum.Text)
'定义墙单元信息列表,包含-层号、-墙厚、-保护层厚、-混凝土等级、-钢筋等级、-Sap构件名称 Dim WallElementsList As ArrayList = New ArrayList For i = 0 To Me.DataGridView.RowCount - 1
WallElementsList.Add(New Object() {Me.DataGridView(0, i).Value, Me.DataGridView(1, i).Value, Me.DataGridView(2, i).Value, Me.DataGridView(3, i).Value, Me.DataGridView(4, i).Value, Me.DataGridView(5, i).Value, Me.DataGridView(0, i).Value + \ + Me.DataGridView(2, i).Value + \ + Me.DataGridView(3, i).Value + \ + Me.DataGridView(4, i).Value + \ + Me.DataGridView(5, i).Value}) Next
'定义层高列表并赋值
Dim StoryHeightList As ArrayList = New ArrayList For i = 0 To StoryNum - 1
StoryHeightList.Add(WallElementsList(i)(1)) Next
'定义墙厚列表并赋值
Dim WallThicknessList As ArrayList = New ArrayList For i = 0 To StoryNum - 1
WallThicknessList.Add(WallElementsList(i)(2)) Next
'定义混凝土保护层厚度列表并赋值
Dim ConcreteCoverList As ArrayList = New ArrayList For i = 0 To StoryNum - 1
ConcreteCoverList.Add(WallElementsList(i)(3)) Next
'定义混凝土等级列表并赋值
Dim ConcreteGradeList As ArrayList = New ArrayList For i = 0 To StoryNum - 1
ConcreteGradeList.Add(WallElementsList(i)(4)) Next
'定义钢筋等级列表并赋值
Dim RebarClassList As ArrayList = New ArrayList For i = 0 To StoryNum - 1
RebarClassList.Add(WallElementsList(i)(5)) Next
'定义Sap截面名称列表并赋值
Dim SapMemberSectionList As ArrayList = New ArrayList For i = 0 To StoryNum - 1
SapMemberSectionList.Add(WallElementsList(i)(6)) Next
'定义Sap构件名称列表并赋值
Dim SapMemberNameList As ArrayList = New ArrayList For i = 0 To StoryNum - 1
SapMemberNameList.Add(WallElementsList(i)(0))
正在阅读:
SAP2000API代码-挡土墙10-13
0-2011年度董事会工作报告02-02
石家庄的秋天作文300字06-22
《外汇交易》复习题2010-12+题型11-27
令我自责的一件事作文600字07-06
领导干部在律师培训班上的讲话01-31
公路路基施工技术规范JTJ033—9512-10
学校打架思想汇报06-06
学习贯彻习近平总书记重要训词精神讲话材料09-08
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 挡土墙
- SAP2000API
- 代码