' 'Sub rotate_3Dbox() ' Dim boxobj As Acad3DSolid ' Dim length As Double ' Dim width As Double ' Dim height As Double ' Dim center(0 To 2) As Double ' ' center(0) = 5 ' center(1) = 5 ' center(2) = 0 ' length = 5 ' width = 7 ' height = 9 ' ' ' Set boxobj = ThisDrawing.ModelSpace.AddBox(center, length, width, height) 'End Sub
Option Explicit
Private Sub cmdcreatebeam_Click()
beamwidth = Scrlwidth.Value beamheight = Scrlheight.Value beamwebthickness = Scrlthickness.Value solidlength = scrllength.Value If checkrules(beamwidth, beamheight, beamwebthickness) Then createibeam beamwidth, beamheight, beamwebthickness, solidlength updatamomentandsection beamwidth, beamheight, beamwebthickness Else MsgBox "sorry,the beam cannot be created with your settings.", vbExclamation If Not (beamexists) Then MsgBox "defult setting restored.", vbInformation Scrlwidth.Value = 650 Scrlheight.Value = 650 Scrlthickness.Value = 125 scrllength.Value = 200 End If End If End Sub
Private Sub cmdquit_Click() Unload Me End Sub
Private Sub Label8_Click()
End Sub
Private Sub Scrlheight_Change() If beamexists = True Then If checkrules(beamwidth, Scrlheight.Value, beamwebthickness) Then beamheight = Scrlheight.Value updatabeam beamwidth, beamheight, beamwebthickness, solidlength updatamomentandsection beamwidth, beamheight, beamwebthickness Else Scrlheight.Value = beamheight End If End If End Sub
Private Sub scrllength_Change() If beamexists Then solidlength = scrllength.Value updatabeam beamwidth, beamheight, beamwebthickness, solidlength updatamomentandsection beamwidth, beamheight, beamwebthickness End If End Sub
Private Sub Scrlthickness_Change() If beamexists Then If checkrules(beamwidth, beamheight, Scrlthickness.Value) Then beamwebthickness = Scrlthickness.Value updatabeam beamwidth, beamheight, beamwebthickness, solidlength updatamomentandsection beamwidth, beamheight, beamwebthickness Else Scrlthickness.Value = beamwebthickness End If End If End Sub
Private Sub Scrlwidth_Change() If beamexists Then If checkrules(Scrlwidth.Value, beamheight, beamwebthickness) Then beamwidth = Scrlwidth.Value updatabeam beamwidth, beamheight, beamwebthickness, solidlength updatamomentandsection beamwidth, beamheight, beamwebthickness Else Scrlwidth.Value = beamwidth End If End If End Sub
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Initialize() Scrlwidth.Value = 650 Scrlheight.Value = 650 Scrlthickness.Value = 125 scrllength.Value = 200 End Sub
Private Sub updatamomentandsection(beamwidth#, beamheight#, beamwebthickness#) beammi = momentofinteria(beamwidth, beamheight, beamwebthickness) beamsectmod = sectionmodulus(beamwidth, beamheight, beamwebthickness) Label8.Caption = Format(beammi, "0.0000E+00") Label7.Caption = Format(beamsectmod, "0.0000E+00") End Sub
Private Sub UserForm_Terminate() Set solidobject = Nothing Dim entry As Object For Each entry In ThisDrawing.Blocks If entry.Name = "BUFFBLOCK" Then buffblock.Delete End If Next beamexists = False End Sub
这是窗体程序,现在的问题就是想点击画的图就弹出窗体 |