Upload
apriliana-kurniasari
View
115
Download
3
Embed Size (px)
Citation preview
TUGAS
PEMROGRAMAN KOMPUTER
(TEKUK KOLOM)
Di kerjakan oleh
Wanda Nugraha I0109104
Alfi Noor Rokhman I0110012
Hanif Yuniarta I0110051
Nadiya Ramadhani Putri I0110082
JURUSAN TEKNIK SIPIL FAKULTAS TEKNIK
UNIVERSITAS SEBELAS MARET
SURAKARTA
2011
ALGORITMA OPERASI TEKUK KOLOM
1. Algoritma Program Tekuk Kolom
a. Algoritma cara hitung langsung
1. Memulai
Menjalankan program
2. Memilih perletakan
Membaca data pilihan yang telah dimasukkan:
2.1 sendi - sendi
2.2 sendi – jepit
2.3 jepit – jepit
2.4 jepit - bebas
3. Memilih penampang
3.1 penampang T
3.2 penampang L
4. Memilih jenis bahan penampang
4.1 bahan baja = 120000 mpa
4.2 bahan alumunium = 200000 mpa
4.3 bahan beton = 20000 mpa
4.4 bahan lainnya (memasukan data sendiri)
5. Memilih panjang batang
L
6. Memasukan nilai dimensi a,b,c,d (milimeter)
a b
c a
b
d c d
7. Tampilkan hasil perhitungan
7.1 Ix kanan-kiri
7.2 Iy atas – bawah
7.3 Pmax
7.4 P diperbolehkan
8. Selesai
MODEL MATEMATIKA OPERASI TEKUK KOLOM
p p p p
Pkritis= π2. E . IL2 Pkritis= π2. E . I
0,5 L2 Pkritis= π2. E . I0.699 L2 Pkritis
π2 . E . I2 L2
Sendi-Sendi Jepit-Jepit Jepit-Sendi Jepit-Bebas
DIAGRAM ALIR PROGRAM TEKUK KOLOM
MULAI
Input : Memilih perltakan ; bentuk penampang ( L , T ) ; jenis penampang (baja,alumunium,beton,dll) ; panjang bentang batang ; dan memasukan nilai
Pilih 1 perletakan dari 4 perletakan
Sendi-sendi jepit-jepit Sendi-jepit jepit-bebas
Tampilkan hasil Perhitungan
Pilih bentuk penampang
Pilih Jenis penampang (alumunium,baja,beton,dll
Masukan panjang bentang
Masukan Nilai dimensi (a,b,c)
SELESAI
USER INTERFACE PROGRAM
Program Selamat datang :
HOME :
Perletakan sendi - sendi
Perletakan jepit-jepit
Perletakan sendi - jepit
Perletakan Jepit - bebas
Materi Program tekuk kolom
KODING PROGRAM
Form selamat datang
Private Sub Command1_Click() Form1.Show frmSelamatDatang.HideEnd Sub
Form materi
Private Sub Command1_Click() Unload Me Form1.ShowEnd Sub
Form pemilihan
Private Sub cmnJepit2_Click() frmJepit2.Show
End Sub
Private Sub cmnJepitBebas_Click()frmJepitBebas.ShowEnd Sub
Private Sub cmnSendi2_Click() frmSendi2.Show End Sub
Private Sub cmnSendiJepit_Click() frmSendiJepit.ShowEnd Sub
Private Sub Command1_Click() frmHasil.Show End Sub
Private Sub mnuEditFont_Click() With dlgCommon.Flags = cdlCFScreenFonts.ShowFontcmnSendi2.Font.Name = .FontNamecmnSendi2.Font.Bold = .FontBoldcmnSendi2.Font.Italic = .FontItaliccmnSendi2.Font.Size = .FontSizecmnJepit2.Font.Name = .FontNamecmnJepit2.Font.Bold = .FontBoldcmnJepit2.Font.Italic = .FontItaliccmnJepit2.Font.Size = .FontSizecmnSendiJepit.Font.Name = .FontNamecmnSendiJepit.Font.Bold = .FontBoldcmnSendiJepit.Font.Italic = .FontItaliccmnSendiJepit.Font.Size = .FontSizecmnJepitBebas.Font.Name = .FontNamecmnJepitBebas.Font.Bold = .FontBoldcmnJepitBebas.Font.Italic = .FontItaliccmnJepitBebas.Font.Size = .FontSizeCommand1.Font.Name = .FontNameCommand1.Font.Bold = .FontBoldCommand1.Font.Italic = .FontItalicCommand1.Font.Size = .FontSizelblJudul.Font.Name = .FontNamelblJudul.Font.Bold = .FontBoldlblJudul.Font.Italic = .FontItalicEnd WithEnd SubPrivate Sub mnuEdtWarnaFrame_Click() With dlgCommon .ShowColor Frame1.BackColor = .Color End WithEnd Sub
Private Sub mnuEdtWarnaFont_Click() With dlgCommon.ShowColorcmnSendi2.BackColor = .ColorcmnJepit2.BackColor = .ColorcmnSendiJepit.BackColor = .ColorcmnJepitBebas.BackColor = .ColorCommand1.BackColor = .ColorlblJudul.ForeColor = .Color
End WithEnd Sub
Private Sub mnuEdtWarnaImage_Click() With dlgCommon .ShowColor Picture1.BackColor = .Color Shape2.FillColor = .Color End WithEnd Sub
Private Sub mnuFileExit_Click() keluar = MsgBox("Are y0u Sure to eXit fr0m thiS pR0graM?", vbYesNo, "Exit") If keluar = vbYes Then frmSelamatDatang.Hide Form1.Hide Unload Me Else Form1.Show End IfEnd Sub
Private Sub mnuFileSave_Click() With dlgCommon .ShowSave End WithEnd Sub
Private Sub mnuHelpAbout_Click() frmAbout.ShowEnd Sub
Private Sub mnuHelpLisensi_Click() Form2.Show End Sub
Private Sub mnuHelpMateri_Click() Materi.Show End Sub
Private Sub mnuPilPerletaknJepit2_Click() frmJepit2.Show
Form1.HideEnd Sub
Private Sub mnuPilPerletaknJepitB_Click() frmJepitBebas.Show Form1.Hide frmJepit2.Hide frmSendi2.Hide End Sub
Private Sub mnuPilPerletaknSendi2_Click() frmSendi2.Show Form1.Hide frmJepit2.Hide frmSelamatDatang.Hide End Sub
Private Sub mnuPilPerletaknSendiJepit_Click() frmSendiJepit.Show Form1.Hide frmJepit2.Hide frmSendi2.HideEnd Sub
Form lisensi
Private Sub Command1_Click() Unload Me Form1.ShowEnd Sub
Form about
Private Sub Command1_Click() frmAbout.HideEnd Sub
Form jepit – jepit
Dim pilihan, titik, iPrivate Sub Form_Load() cmbPenampang1.AddItem ("Penampang T") cmbPenampang1.AddItem ("Penampang L")
End Sub
Private Sub cmbPenampang1_Click() If cmbPenampang1.Text = "Penampang T" Then picT.Visible = True picL.Visible = False txtPenampang1.Text = "Penampang T" End If If cmbPenampang1.Text = "Penampang L" Then picT.Visible = False picL.Visible = True txtPenampang1.Text = "Penampang L" End If End SubPrivate Sub optAl1_Click() If optAl1.Value = True Then txtE.Text = "200000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optBaja1_Click() If optBaja1.Value = True Then txtE.Text = "120000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optBeton1_Click() If optBeton1.Value = True Then txtE.Text = "20000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optLain_Click() If optLain.Value = True Then Label13.Visible = True Label14.Visible = True txtE.Visible = True End IfEnd Sub
Private Sub cmnHitung_Click() Dim i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11 As Single L = Val(txtPanjangBatang.Text) a = Val(txtA.Text)
b = Val(txtB.Text) c = Val(txtC.Text) d = Val(txtD.Text) E = Val(txtE.Text) If txtPanjangBatang.Text = "0" Or txtA.Text = "0" Or txtB.Text = "0" Or txtC.Text = "0" Or txtD.Text = "0" Then MsgBox "Data tidak valid, mhon ulangi input data", vbOKOnly, "Tidak Valid" txtPanjangBatang.Text = "" txtDiameter.Text = "" End If If cmbPenampang1.Text = "Penampang L" Then If txtPanjangBatang.Text = "" Or txtA.Text = "" Or txtB.Text = "" Or txtC.Text = "" Or txtD.Text = "" Then MsgBox "Input data Anda terlebih dahulu", vbOKOnly, "Isi Input" Else i1 = a * c 'luas bidang 1 i2 = b * (c + d) 'luas bidang 2 i3 = i1 + i2 'LUAS TOTAL i4 = ((i1 * 0.5 * a) + (i2 * (a + 0.5 * b))) / i3 'titik berat dr atas i5 = (a + b) - i4 'titik berat dr bawah i6 = ((1 / 12) * c * a ^ 3) + (i1 * ((i4 - 0.5 * a) ^ 2)) + ((1 / 12) * (c + d) * (b ^ 3)) + (i2 * ((i5 - 0.5 * b) ^ 2)) i7 = ((i1 * 0.5 * c) + (i2 * 0.5 * (c + d))) / i3 'titik berat dr kiri i8 = (c + d) - i7 'titik berat dr kanan i9 = ((1 / 12) * a * c ^ 3) + (i1 * ((i7 - 0.5 * c) ^ 2)) + ((1 / 12) * b * ((c + d) ^ 3)) + (i2 * ((i8 - 0.5 * (c + d)) ^ 2))
i10 = (3.14 ^ 2 * E * i2) / (((0.5 * L) ^ 2) * 10 ^ 6) 'nilai Pmax i11 = i10 / 2.3 ' nilai P ijin txtIx.Text = CStr(i6) txtIy.Text = CStr(i9) txtPmax.Text = CStr(i10) txtPijin.Text = CStr(i11) frmHasil1.Visible = True End If End If If cmbPenampang1.Text = "Penampang T" Then If txtPanjangBatang.Text = "" Or txtA.Text = "" Or txtB.Text = "" Or txtC.Text = "" Or txtD.Text = "" Then MsgBox "Input data Anda terlebih dahulu", vbOKOnly, "Isi Input" Else i1 = a * b 'luas bidang 1 i2 = c * d 'luas bidang 2 i3 = i1 + i2 'LUAS TOTAL i4 = ((i1 * 0.5 * b) + (i2 * (b + 0.5 * c))) / i3 'titik berat dr atas
i5 = (a + b) - i4 'titik berat dr bawah i6 = ((1 / 12) * a * b ^ 3) + (i1 * ((i4 - 0.5 * b) ^ 2)) + ((1 / 12) * d * (c ^ 3)) + (i2 * ((i5 - 0.5 * i7 = a / 2 'titik berat dr kiri-kanan i9 = ((1 / 12) * b * a ^ 3) + ((1 / 12) * c * (d ^ 3))
i10 = (3.14 ^ 2 * E * i2) / (((0.5 * L) ^ 2) * 10 ^ 6) 'nilai Pmax i11 = i10 / 2.3 ' nilai P ijin txtIx.Text = CStr(i6) txtIy.Text = CStr(i9) txtPmax.Text = CStr(i10) txtPijin.Text = CStr(i11) frmHasil1.Visible = True End If End If End Sub
Private Sub cmnReset_Click() frmData.Visible = False txtPanjangBatang.Text = "" txtA.Text = "" txtB.Text = "" txtC.Text = "" txtD.Text = "" picT.Visible = False picL.Visible = False frmHasil1.Visible = False optBaja1.Value = False optAl1.Value = False optBeton1.Value = False optLain.Value = False cmbPenampang1.Text = "Pilih Bentuk Penampang" End Sub
Private Sub cmnSave_Click()
Data1.Recordset.AddNew Data1.Recordset.Fields("Panjang Batang") = txtPanjangBatang.Text Data1.Recordset.Fields("Perletakan") = txtJepit2.Text Data1.Recordset.Fields("Bentuk Penampang") = txtPenampang1.Text Data1.Recordset.Fields("Nilai a") = txtA.Text Data1.Recordset.Fields("Nilai b") = txtB.Text Data1.Recordset.Fields("Nilai c") = txtC.Text Data1.Recordset.Fields("Nilai d") = txtD.Text Data1.Recordset.Fields("E") = txtE.Text Data1.Recordset.Fields("Ix") = txtIx.Text Data1.Recordset.Fields("Iy") = txtIy.Text Data1.Recordset.Fields("Pmax") = txtPmax.Text Data1.Recordset.Fields("Pijin") = txtPijin.Text Data1.Recordset.Update
Data1.Refresh
txtPanjangBatang.Text = "" txtA.Text = "" txtB.Text = "" txtC.Text = "" txtD.Text = "" frmHasil1.Visible = False optBaja1.Value = False optAl1.Value = False optBeton1.Value = False optLain.Value = False picT.Visible = False picL.Visible = False cmbPenampang1.Text = "Pilih Bentuk Penampang"End Sub
Private Sub Command2_Click() Form1.Show frmJepit2.Hide frmHasil1.Visible = False picT.Visible = False picL.Visible = False frmData.Visible = False Label13.Visible = False Label14.Visible = False txtE.Visible = False cmbPenampang1.Text = "Pilih Bentuk Penampang" End Sub
Private Sub cmnBack_Click() Form1.Show frmJepit2.HideEnd Sub
Private Sub txtIx_Change() txtIx.Text = Round(txtIx.Text, 4)End Sub
Private Sub txtIy_Change() txtIy.Text = Round(txtIy.Text, 4)End Sub
Private Sub txtPijin_Change() txtPijin.Text = Round(txtPijin.Text, 4)End Sub
Private Sub txtPmax_Change()
txtPmax.Text = Round(txtPmax.Text, 4)End Sub
Private Sub txtPanjangBatang_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtPanjangBatang.Text) ' Mengaktifkan titik menjadi True If Mid(txtPanjangBatang.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd SubPrivate Sub txtLebar_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtLebar.Text) ' Mengaktifkan titik menjadi True If Mid(txtLebar.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd SubPrivate Sub txtDiameter_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtDiameter.Text) ' Mengaktifkan titik menjadi True If Mid(txtDiameter.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd Sub
Private Sub txtE_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtE.Text) ' Mengaktifkan titik menjadi True
If Mid(txtE.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd Sub
Form jepit – bebas
Dim pilihan, titik, iPrivate Sub Form_Load() cmbPenampang1.AddItem ("Penampang T") cmbPenampang1.AddItem ("Penampang L") End Sub
Private Sub cmbPenampang1_Click() If cmbPenampang1.Text = "Penampang T" Then picT.Visible = True picL.Visible = False txtPenampang1.Text = "Penampang T" End If If cmbPenampang1.Text = "Penampang L" Then picT.Visible = False picL.Visible = True txtPenampang1.Text = "Penampang L" End If End SubPrivate Sub optAl1_Click() If optAl1.Value = True Then txtE.Text = "200000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optBaja1_Click() If optBaja1.Value = True Then txtE.Text = "120000" Label13.Visible = False Label14.Visible = False
txtE.Visible = False End IfEnd Sub
Private Sub optBeton1_Click() If optBeton1.Value = True Then txtE.Text = "20000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optLain_Click() If optLain.Value = True Then Label13.Visible = True Label14.Visible = True txtE.Visible = True End IfEnd Sub
Private Sub cmnHitung_Click() Dim i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11 As Single L = Val(txtPanjangBatang.Text) a = Val(txtA.Text) b = Val(txtB.Text) c = Val(txtC.Text) d = Val(txtD.Text) E = Val(txtE.Text) If txtPanjangBatang.Text = "0" Or txtA.Text = "0" Or txtB.Text = "0" Or txtC.Text = "0" Or txtD.Text = "0" Then MsgBox "Data tidak valid, mhon ulangi input data", vbOKOnly, "Tidak Valid" txtPanjangBatang.Text = "" txtDiameter.Text = "" End If If cmbPenampang1.Text = "Penampang L" Then If txtPanjangBatang.Text = "" Or txtA.Text = "" Or txtB.Text = "" Or txtC.Text = "" Or txtD.Text = "" Then MsgBox "Input data Anda terlebih dahulu", vbOKOnly, "Isi Input" Else i1 = a * c 'luas bidang 1 i2 = b * (c + d) 'luas bidang 2 i3 = i1 + i2 'LUAS TOTAL i4 = ((i1 * 0.5 * a) + (i2 * (a + 0.5 * b))) / i3 'titik berat dr atas i5 = (a + b) - i4 'titik berat dr bawah i6 = ((1 / 12) * c * a ^ 3) + (i1 * ((i4 - 0.5 * a) ^ 2)) + ((1 / 12) * (c + d) * (b ^ 3)) + (i2 * ((i5 - 0.5 * b) ^ 2)) i7 = ((i1 * 0.5 * c) + (i2 * 0.5 * (c + d))) / i3 'titik berat dr kiri i8 = (c + d) - i7 'titik berat dr kanan
i9 = ((1 / 12) * a * c ^ 3) + (i1 * ((i7 - 0.5 * c) ^ 2)) + ((1 / 12) * b * ((c + d) ^ 3)) + (i2 * ((i8 - 0.5 * (c + d)) ^ 2))
i10 = (3.14 ^ 2 * E * i2) / (((2 * L) ^ 2) * 10 ^ 6) 'nilai Pmax i11 = i10 / 2.3 ' nilai P ijin txtIx.Text = CStr(i6) txtIy.Text = CStr(i9) txtPmax.Text = CStr(i10) txtPijin.Text = CStr(i11) frmHasil1.Visible = True End If End If If cmbPenampang1.Text = "Penampang T" Then If txtPanjangBatang.Text = "" Or txtA.Text = "" Or txtB.Text = "" Or txtC.Text = "" Or txtD.Text = "" Then MsgBox "Input data Anda terlebih dahulu", vbOKOnly, "Isi Input" Else i1 = a * b 'luas bidang 1 i2 = c * d 'luas bidang 2 i3 = i1 + i2 'LUAS TOTAL i4 = ((i1 * 0.5 * b) + (i2 * (b + 0.5 * c))) / i3 'titik berat dr atas i5 = (a + b) - i4 'titik berat dr bawah i6 = ((1 / 12) * a * b ^ 3) + (i1 * ((i4 - 0.5 * b) ^ 2)) + ((1 / 12) * d * (c ^ 3)) + (i2 * ((i5 - 0.5 * c) ^ 2)) i7 = a / 2 'titik berat dr kiri-kanan i9 = ((1 / 12) * b * a ^ 3) + ((1 / 12) * c * (d ^ 3))
i10 = (3.14 ^ 2 * E * i2) / (((2 * L) ^ 2) * 10 ^ 6) 'nilai Pmax i11 = i10 / 2.3 ' nilai P ijin txtIx.Text = CStr(i6) txtIy.Text = CStr(i9) txtPmax.Text = CStr(i10) txtPijin.Text = CStr(i11) frmHasil1.Visible = True End If End If End Sub
Private Sub cmnReset_Click() frmData.Visible = False txtPanjangBatang.Text = "" txtA.Text = "" txtB.Text = "" txtC.Text = ""
txtD.Text = "" picT.Visible = False picL.Visible = False frmHasil1.Visible = False optBaja1.Value = False optAl1.Value = False optBeton1.Value = False optLain.Value = False cmbPenampang1.Text = "Pilih Bentuk Penampang" End Sub
Private Sub cmnSave_Click()
Data1.Recordset.AddNew Data1.Recordset.Fields("Panjang Batang") = txtPanjangBatang.Text Data1.Recordset.Fields("Perletakan") = txtJepit2.Text Data1.Recordset.Fields("Bentuk Penampang") = txtPenampang1.Text Data1.Recordset.Fields("Nilai a") = txtA.Text Data1.Recordset.Fields("Nilai b") = txtB.Text Data1.Recordset.Fields("Nilai c") = txtC.Text Data1.Recordset.Fields("Nilai d") = txtD.Text Data1.Recordset.Fields("E") = txtE.Text Data1.Recordset.Fields("Ix") = txtIx.Text Data1.Recordset.Fields("Iy") = txtIy.Text Data1.Recordset.Fields("Pmax") = txtPmax.Text Data1.Recordset.Fields("Pijin") = txtPijin.Text Data1.Recordset.Update Data1.Refresh
txtPanjangBatang.Text = "" txtA.Text = "" txtB.Text = "" txtC.Text = "" txtD.Text = "" frmHasil1.Visible = False optBaja1.Value = False optAl1.Value = False optBeton1.Value = False optLain.Value = False picT.Visible = False picL.Visible = False cmbPenampang1.Text = "Pilih Bentuk Penampang"End Sub
Private Sub Command2_Click() Form1.Show frmJepitBebas.Hide frmHasil1.Visible = False picT.Visible = False picL.Visible = False frmData.Visible = False Label13.Visible = False
Label14.Visible = False txtE.Visible = False cmbPenampang1.Text = "Pilih Bentuk Penampang" End Sub
Private Sub cmnBack_Click() Form1.Show frmJepit2.HideEnd Sub
Private Sub txtIx_Change() txtIx.Text = Round(txtIx.Text, 4)End Sub
Private Sub txtIy_Change() txtIy.Text = Round(txtIy.Text, 4)End Sub
Private Sub txtPijin_Change() txtPijin.Text = Round(txtPijin.Text, 4)End Sub
Private Sub txtPmax_Change() txtPmax.Text = Round(txtPmax.Text, 4)End Sub
Private Sub txtPanjangBatang_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtPanjangBatang.Text) ' Mengaktifkan titik menjadi True If Mid(txtPanjangBatang.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd SubPrivate Sub txtLebar_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtLebar.Text) ' Mengaktifkan titik menjadi True If Mid(txtLebar.Text, i, 1) = "." Then titik = True End If Next
If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd SubPrivate Sub txtDiameter_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtDiameter.Text) ' Mengaktifkan titik menjadi True If Mid(txtDiameter.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd Sub
Private Sub txtE_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtE.Text) ' Mengaktifkan titik menjadi True If Mid(txtE.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd Sub
Form sendi – sendi
Dim pilihan, titik, iPrivate Sub Form_Load() cmbPenampang1.AddItem ("Penampang T") cmbPenampang1.AddItem ("Penampang L")
End Sub
Private Sub cmbPenampang1_Click() If cmbPenampang1.Text = "Penampang T" Then picT.Visible = True picL.Visible = False frmData.Visible = True txtPenampang1.Text = "Penampang T" End If If cmbPenampang1.Text = "Penampang L" Then picT.Visible = False picL.Visible = True frmData.Visible = True txtPenampang1.Text = "Penampang L" End If End SubPrivate Sub optAl1_Click() If optAl1.Value = True Then txtE.Text = "200000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optBaja1_Click() If optBaja1.Value = True Then txtE.Text = "120000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optBeton1_Click() If optBeton1.Value = True Then txtE.Text = "20000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optLain_Click() If optLain.Value = True Then Label13.Visible = True Label14.Visible = True txtE.Visible = True End IfEnd Sub
Private Sub cmnHitung_Click() Dim i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11 As Single
L = Val(txtPanjangBatang.Text) a = Val(txtA.Text) b = Val(txtB.Text) c = Val(txtC.Text) d = Val(txtD.Text) E = Val(txtE.Text) If txtPanjangBatang.Text = "0" Or txtA.Text = "0" Or txtB.Text = "0" Or txtC.Text = "0" Or txtD.Text = "0" Then MsgBox "Data tidak valid, mhon ulangi input data", vbOKOnly, "Tidak Valid" txtPanjangBatang.Text = "" txtDiameter.Text = "" End If If cmbPenampang1.Text = "Penampang L" Then If txtPanjangBatang.Text = "" Or txtA.Text = "" Or txtB.Text = "" Or txtC.Text = "" Or txtD.Text = "" Then MsgBox "Input data Anda terlebih dahulu", vbOKOnly, "Isi Input" Else i1 = a * c 'luas bidang 1 i2 = b * (c + d) 'luas bidang 2 i3 = i1 + i2 'LUAS TOTAL i4 = ((i1 * 0.5 * a) + (i2 * (a + 0.5 * b))) / i3 'titik berat dr atas i5 = (a + b) - i4 'titik berat dr bawah i6 = ((1 / 12) * c * a ^ 3) + (i1 * ((i4 - 0.5 * a) ^ 2)) + ((1 / 12) * (c + d) * (b ^ 3)) + (i2 * ((i5 - 0.5 * b) ^ 2)) i7 = ((i1 * 0.5 * c) + (i2 * 0.5 * (c + d))) / i3 'titik berat dr kiri i8 = (c + d) - i7 'titik berat dr kanan i9 = ((1 / 12) * a * c ^ 3) + (i1 * ((i7 - 0.5 * c) ^ 2)) + ((1 / 12) * b * ((c + d) ^ 3)) + (i2 * ((i8 - 0.5 * (c + d)) ^ 2))
i10 = (3.14 ^ 2 * E * i2) / (((1 * L) ^ 2) * 10 ^ 6) 'nilai Pmax i11 = i10 / 2.3 ' nilai P ijin txtIx.Text = CStr(i6) txtIy.Text = CStr(i9) txtPmax.Text = CStr(i10) txtPijin.Text = CStr(i11) frmHasil1.Visible = True End If End If If cmbPenampang1.Text = "Penampang T" Then If txtPanjangBatang.Text = "" Or txtA.Text = "" Or txtB.Text = "" Or txtC.Text = "" Or txtD.Text = "" Then MsgBox "Input data Anda terlebih dahulu", vbOKOnly, "Isi Input" Else i1 = a * b 'luas bidang 1 i2 = c * d 'luas bidang 2
i3 = i1 + i2 'LUAS TOTAL i4 = ((i1 * 0.5 * b) + (i2 * (b + 0.5 * c))) / i3 'titik berat dr atas i5 = (a + b) - i4 'titik berat dr bawah i6 = ((1 / 12) * a * b ^ 3) + (i1 * ((i4 - 0.5 * b) ^ 2)) + ((1 / 12) * d * (c ^ 3)) + (i2 * ((i5 - 0.5 * c) ^ 2)) i7 = a / 2 'titik berat dr kiri-kanan i9 = ((1 / 12) * b * a ^ 3) + ((1 / 12) * c * (d ^ 3))
i10 = (3.14 ^ 2 * E * i2) / (((1 * L) ^ 2) * 10 ^ 6) 'nilai Pmax i11 = i10 / 2.3 ' nilai P ijin txtIx.Text = CStr(i6) txtIy.Text = CStr(i9) txtPmax.Text = CStr(i10) txtPijin.Text = CStr(i11) frmHasil1.Visible = True End If End If End Sub
Private Sub cmnReset_Click() frmData.Visible = False txtPanjangBatang.Text = "" txtA.Text = "" txtB.Text = "" txtC.Text = "" txtD.Text = "" picT.Visible = False picL.Visible = False frmHasil1.Visible = False optBaja1.Value = False optAl1.Value = False optBeton1.Value = False optLain.Value = False cmbPenampang1.Text = "Pilih Bentuk Penampang"End Sub
Private Sub cmnSave_Click()
Data1.Recordset.AddNew Data1.Recordset.Fields("Panjang Batang") = txtPanjangBatang.Text Data1.Recordset.Fields("Perletakan") = txtJepit2.Text Data1.Recordset.Fields("Bentuk Penampang") = txtPenampang1.Text Data1.Recordset.Fields("Nilai a") = txtA.Text Data1.Recordset.Fields("Nilai b") = txtB.Text Data1.Recordset.Fields("Nilai c") = txtC.Text Data1.Recordset.Fields("Nilai d") = txtD.Text Data1.Recordset.Fields("E") = txtE.Text Data1.Recordset.Fields("Ix") = txtIx.Text Data1.Recordset.Fields("Iy") = txtIy.Text
Data1.Recordset.Fields("Pmax") = txtPmax.Text Data1.Recordset.Fields("Pijin") = txtPijin.Text Data1.Recordset.Update Data1.Refresh
txtPanjangBatang.Text = "" txtA.Text = "" txtB.Text = "" txtC.Text = "" txtD.Text = "" frmHasil1.Visible = False optBaja1.Value = False optAl1.Value = False optBeton1.Value = False optLain.Value = False picT.Visible = False picL.Visible = False cmbPenampang1.Text = "Pilih Bentuk Penampang"End Sub
Private Sub Command2_Click() Form1.Show frmSendi2.Hide frmHasil1.Visible = False picT.Visible = False picL.Visible = False frmData.Visible = False Label13.Visible = False Label14.Visible = False txtE.Visible = False cmbPenampang1.Text = "Pilih Bentuk Penampang" End Sub
Private Sub cmnBack_Click() Form1.Show frmJepit2.HideEnd Sub
Private Sub txtIx_Change() txtIx.Text = Round(txtIx.Text, 4)End Sub
Private Sub txtIy_Change() txtIy.Text = Round(txtIy.Text, 4)End Sub
Private Sub txtPijin_Change()
txtPijin.Text = Round(txtPijin.Text, 4)End Sub
Private Sub txtPmax_Change() txtPmax.Text = Round(txtPmax.Text, 4)End Sub
Private Sub txtPanjangBatang_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtPanjangBatang.Text) ' Mengaktifkan titik menjadi True If Mid(txtPanjangBatang.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd SubPrivate Sub txtLebar_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtLebar.Text) ' Mengaktifkan titik menjadi True If Mid(txtLebar.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd SubPrivate Sub txtDiameter_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtDiameter.Text) ' Mengaktifkan titik menjadi True If Mid(txtDiameter.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd Sub
Private Sub txtE_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtE.Text) ' Mengaktifkan titik menjadi True If Mid(txtE.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd Sub
Form sendi – jepit
Dim pilihan, titik, iPrivate Sub Form_Load() cmbPenampang1.AddItem ("Penampang T") cmbPenampang1.AddItem ("Penampang L") End Sub
Private Sub cmbPenampang1_Click() If cmbPenampang1.Text = "Penampang T" Then picT.Visible = True picL.Visible = False txtPenampang1.Text = "Penampang T" End If If cmbPenampang1.Text = "Penampang L" Then picT.Visible = False picL.Visible = True txtPenampang1.Text = "Penampang L" End If End Sub
Private Sub Image1_Click()
End Sub
Private Sub optAl1_Click() If optAl1.Value = True Then txtE.Text = "200000" Label13.Visible = False Label14.Visible = False
txtE.Visible = False End IfEnd Sub
Private Sub optBaja1_Click() If optBaja1.Value = True Then txtE.Text = "120000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optBeton1_Click() If optBeton1.Value = True Then txtE.Text = "20000" Label13.Visible = False Label14.Visible = False txtE.Visible = False End IfEnd Sub
Private Sub optLain_Click() If optLain.Value = True Then Label13.Visible = True Label14.Visible = True txtE.Visible = True End IfEnd Sub
Private Sub cmnHitung_Click() Dim i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11 As Single L = Val(txtPanjangBatang.Text) a = Val(txtA.Text) b = Val(txtB.Text) c = Val(txtC.Text) d = Val(txtD.Text) E = Val(txtE.Text) If txtPanjangBatang.Text = "0" Or txtA.Text = "0" Or txtB.Text = "0" Or txtC.Text = "0" Or txtD.Text = "0" Then MsgBox "Data tidak valid, mhon ulangi input data", vbOKOnly, "Tidak Valid" txtPanjangBatang.Text = "" txtDiameter.Text = "" End If If cmbPenampang1.Text = "Penampang L" Then If txtPanjangBatang.Text = "" Or txtA.Text = "" Or txtB.Text = "" Or txtC.Text = "" Or txtD.Text = "" Then MsgBox "Input data Anda terlebih dahulu", vbOKOnly, "Isi Input" Else i1 = a * c 'luas bidang 1 i2 = b * (c + d) 'luas bidang 2
i3 = i1 + i2 'LUAS TOTAL i4 = ((i1 * 0.5 * a) + (i2 * (a + 0.5 * b))) / i3 'titik berat dr atas i5 = (a + b) - i4 'titik berat dr bawah i6 = ((1 / 12) * c * a ^ 3) + (i1 * ((i4 - 0.5 * a) ^ 2)) + ((1 / 12) * (c + d) * (b ^ 3)) + (i2 * ((i5 - 0.5 * b) ^ 2)) i7 = ((i1 * 0.5 * c) + (i2 * 0.5 * (c + d))) / i3 'titik berat dr kiri i8 = (c + d) - i7 'titik berat dr kanan i9 = ((1 / 12) * a * c ^ 3) + (i1 * ((i7 - 0.5 * c) ^ 2)) + ((1 / 12) * b * ((c + d) ^ 3)) + (i2 * ((i8 - 0.5 * (c + d)) ^ 2)) If i6 > i9 Then i10 = (3.14 ^ 2 * E * i9) / (((0.699 * L) ^ 2) * 10 ^ 6) 'nilai Pmax Else i10 = (3.14 ^ 2 * E * i6) / (((0.699 * L) ^ 2) * 10 ^ 6) End If i11 = i10 / 2.3 ' nilai P ijin txtIx.Text = CStr(i6) txtIy.Text = CStr(i9) txtPmax.Text = CStr(i10) txtPijin.Text = CStr(i11) frmHasil1.Visible = True End If End If If cmbPenampang1.Text = "Penampang T" Then If txtPanjangBatang.Text = "" Or txtA.Text = "" Or txtB.Text = "" Or txtC.Text = "" Or txtD.Text = "" Then MsgBox "Input data Anda terlebih dahulu", vbOKOnly, "Isi Input" Else i1 = a * b 'luas bidang 1 i2 = c * d 'luas bidang 2 i3 = i1 + i2 'LUAS TOTAL i4 = ((i1 * 0.5 * b) + (i2 * (b + 0.5 * c))) / i3 'titik berat dr atas i5 = (a + b) - i4 'titik berat dr bawah i6 = ((1 / 12) * a * b ^ 3) + (i1 * ((i4 - 0.5 * b) ^ 2)) + ((1 / 12) * d * (c ^ 3)) + (i2 * ((i5 - 0.5 * c) ^ 2)) i7 = a / 2 'titik berat dr kiri-kanan i9 = ((1 / 12) * b * a ^ 3) + ((1 / 12) * c * (d ^ 3)) If i6 > i9 Then i10 = (3.14 ^ 2 * E * i9) / (((0.699 * L) ^ 2) * 10 ^ 6) 'nilai Pmax Else i10 = (3.14 ^ 2 * E * i6) / (((0.699 * L) ^ 2) * 10 ^ 6) End If i11 = i10 / 2.3 ' nilai P ijin txtIx.Text = CStr(i6)
txtIy.Text = CStr(i9) txtPmax.Text = CStr(i10) txtPijin.Text = CStr(i11) frmHasil1.Visible = True End If End If End Sub
Private Sub cmnReset_Click() frmData.Visible = False txtPanjangBatang.Text = "" txtA.Text = "" txtB.Text = "" txtC.Text = "" txtD.Text = "" picT.Visible = False picL.Visible = False frmHasil1.Visible = False optBaja1.Value = False optAl1.Value = False optBeton1.Value = False optLain.Value = False cmbPenampang1.Text = "Pilih Bentuk Penampang"End Sub
Private Sub cmnSave_Click()
Data1.Recordset.AddNew Data1.Recordset.Fields("Panjang Batang") = txtPanjangBatang.Text Data1.Recordset.Fields("Perletakan") = txtJepit2.Text Data1.Recordset.Fields("Bentuk Penampang") = txtPenampang1.Text Data1.Recordset.Fields("Nilai a") = txtA.Text Data1.Recordset.Fields("Nilai b") = txtB.Text Data1.Recordset.Fields("Nilai c") = txtC.Text Data1.Recordset.Fields("Nilai d") = txtD.Text Data1.Recordset.Fields("E") = txtE.Text Data1.Recordset.Fields("Ix") = txtIx.Text Data1.Recordset.Fields("Iy") = txtIy.Text Data1.Recordset.Fields("Pmax") = txtPmax.Text Data1.Recordset.Fields("Pijin") = txtPijin.Text Data1.Recordset.Update Data1.Refresh
txtPanjangBatang.Text = "" txtA.Text = "" txtB.Text = "" txtC.Text = "" txtD.Text = "" frmHasil1.Visible = False
optBaja1.Value = False optAl1.Value = False optBeton1.Value = False optLain.Value = False picT.Visible = False picL.Visible = False cmbPenampang1.Text = "Pilih Bentuk Penampang"End Sub
Private Sub Command2_Click() Form1.Show frmSendiJepit.Hide frmHasil1.Visible = False picT.Visible = False picL.Visible = False frmData.Visible = False Label13.Visible = False Label14.Visible = False txtE.Visible = False cmbPenampang1.Text = "Pilih Bentuk Penampang" End Sub
Private Sub cmnBack_Click() Form1.Show frmJepit2.HideEnd Sub
Private Sub txtIx_Change() txtIx.Text = Round(txtIx.Text, 4)End Sub
Private Sub txtIy_Change() txtIy.Text = Round(txtIy.Text, 4)End Sub
Private Sub txtPijin_Change() txtPijin.Text = Round(txtPijin.Text, 4)End Sub
Private Sub txtPmax_Change() txtPmax.Text = Round(txtPmax.Text, 4)End Sub
Private Sub txtPanjangBatang_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtPanjangBatang.Text) ' Mengaktifkan titik menjadi True If Mid(txtPanjangBatang.Text, i, 1) = "." Then titik = True End If
Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd SubPrivate Sub txtLebar_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtLebar.Text) ' Mengaktifkan titik menjadi True If Mid(txtLebar.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd SubPrivate Sub txtDiameter_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtDiameter.Text) ' Mengaktifkan titik menjadi True If Mid(txtDiameter.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd Sub
Private Sub txtE_KeyPress(KeyAscii As Integer) titik = False ' Nilai awal titik adalah false For i = 1 To Len(txtE.Text) ' Mengaktifkan titik menjadi True If Mid(txtE.Text, i, 1) = "." Then titik = True End If Next If KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or _ KeyAscii = 46 And titik = False Or KeyAscii = vbKeyBack Then Exit Sub Else
MsgBox "Karakter tidak diperbolehkan", vbInformation, "ERROR" KeyAscii = 0 End IfEnd Sub