求轴支反力的代码vb.docx

上传人:sk****8 文档编号:3192348 上传时间:2019-05-25 格式:DOCX 页数:4 大小:35KB
下载 相关 举报
求轴支反力的代码vb.docx_第1页
第1页 / 共4页
求轴支反力的代码vb.docx_第2页
第2页 / 共4页
求轴支反力的代码vb.docx_第3页
第3页 / 共4页
求轴支反力的代码vb.docx_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

1、Public d As StringPublic l As String Public ld As StringPublic f As StringPublic fx As StringPublic jx As StringPublic zd1 As StringPublic zd2 As StringPrivate Sub CommandButton1_Click()d = TextBox1.Textl = TextBox3.Textld = TextBox2.Textf = TextBox4.TextListBox1.AddItem d & “ “ & ld & “ “ & l & “ “

2、 & f, ListBox1.ListCountSheet1.Cells(ListBox1.ListCount, 1) = dSheet1.Cells(ListBox1.ListCount, 2) = ldSheet1.Cells(ListBox1.ListCount, 3) = lSheet1.Cells(ListBox1.ListCount, 4) = fTextBox1.Text = “TextBox2.Text = “TextBox3.Text = “TextBox4.Text = “End SubPrivate Sub CommandButton2_Click()If ListBox

3、1.ListIndex = -1 ThenMsgBox (“没有可删除的数据!“)ElseIf ListBox1.ListCount ListBox1.ListCount - 1 ThenListBox1.RemoveItem ListBox1.ListIndexSheet1.Rows(ListBox1.ListIndex + 1).DeleteElseIf ListBox1.ListIndex = ListBox1.ListCount - 1 ThenListBox1.RemoveItem ListBox1.ListIndexSheet1.Rows(ListBox1.ListIndex +

4、2).ClearEnd IfEnd SubPrivate Sub CommandButton3_Click()ListBox1.ClearSheet1.Cells.ClearTextBox1.Text = “TextBox2.Text = “TextBox3.Text = “TextBox4.Text = “End SubPrivate Sub CommandButton4_Click()TextBox4.Text = “支点“End SubPrivate Sub CommandButton5_Click()d = TextBox1.Textl = TextBox3.Textld = Text

5、Box2.Textf = TextBox4.TextListBox1.AddItem d & “ “ & ld & “ “ & l & “ “ & f, ListBox1.ListIndex + 1TextBox1.Text = “TextBox2.Text = “TextBox3.Text = “TextBox4.Text = “Sheet1.Rows(ListBox1.ListIndex + 1).InsertSheet1.Cells(ListBox1.ListIndex + 2, 1) = dSheet1.Cells(ListBox1.ListIndex + 2, 2) = ldShee

6、t1.Cells(ListBox1.ListIndex + 2, 3) = lSheet1.Cells(ListBox1.ListIndex + 2, 4) = fEnd SubPrivate Sub CommandButton6_Click() 计算每个点的坐标值并写入 sheet1Sheet1.Cells(1, 5) = Val(Sheet1.Cells(1, 3).Text) 作用点坐标Sheet1.Cells(1, 6) = Val(Sheet1.Cells(1, 2).Text) 轴肩坐标Dim i As Integeri = 2Do Until Sheet1.Cells(i, 1)

7、 = nilSheet1.Cells(i, 5) = Val(Sheet1.Cells(i - 1, 6).Text) + Val(Sheet1.Cells(i, 3).Text)Sheet1.Cells(i, 6) = Val(Sheet1.Cells(i - 1, 6).Text) + Val(Sheet1.Cells(i, 2).Text)i = i + 1LoopDim zd As StringDim i1 As Integer 找出支点位置i1 = 1Do Until Sheet1.Cells(i1, 1) = nilIf Sheet1.Cells(i1, 4) = “支点“ The

8、nzd = zd & i1 & “,“Else: zd = zdEnd Ifi1 = i1 + 1Loopzd1 = Left(zd, Val(InStr(zd, “,“) - 1) 得出支点 1 坐标zd2 = Mid(zd, Val(InStr(zd, “,“) + 1), Val(Len(zd) - Val(InStr(zd, “,“) - 1) 得出支点 2 坐标Dim i2 As Integeri2 = 1 对支点 2 求矩Do Until Sheet1.Cells(i2, 1) = nilSheet1.Cells(i2, 7) = (Val(Sheet1.Cells(i2, 5)

9、- Val(Sheet1.Cells(Val(zd2), 5) * Val(Sheet1.Cells(i2, 4)i2 = i2 + 1Loop得出支反力Dim ra As DoubleDim rb As DoubleDim Mzf As DoubleDim Fzf As DoubleDim i3 As Integeri3 = 2Mzf = Val(Sheet1.Cells(1, 7)Do Until Sheet1.Cells(i3, 1) = nilMzf = Mzf + Val(Sheet1.Cells(i3, 7)i3 = i3 + 1Loopra = Mzf / (Val(Sheet1.Cells(zd1, 5) - Val(Sheet1.Cells(zd2, 5)Dim I4 As IntegerI4 = 2Fzf = Val(Sheet1.Cells(1, 4)Fzf = Val(Sheet1.Cells(1, 4)Do Until Sheet1.Cells(i3, 1) = nilFzf = Fzf + Val(Sheet1.Cells(i3, 4)i3 = i3 + 1Looprb = Fzf - raMsgBox (rb & “ “ & ra & “ “ & Mzf & “ “ & Fzf)End Sub

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育教学资料库 > 精品笔记

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。