- UID
- 15939
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-11-18
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Private Sub ComboBox1_Click()
Dim cn As Connection
Set cn = New Connection
cn.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=d:\cf.mdb;"
Dim cmd As New ADODB.Command
Set cmd.ActiveConnection = cn
cmd.CommandText = "select b,h,name from cf1 where name='" & ComboBox1.Text & "'"
Dim rst As New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.Open cmd, , adOpenStatic, adLockBatchOptimistic
Do While Not rst.EOF
UserForm1.TextBox1.Text = rst("h")
UserForm1.TextBox2.Text = rst("b")
rst.MoveNext
Loop
rst.Clone
End Sub
Private Sub CommandButton1_Click()
UserForm1.Hide
Dim pt As Variant
pt = ThisDrawing.Utility.GetPoint(, "拾取插入点:")
h = Val(UserForm1.TextBox1.Text)
b = Val(UserForm1.TextBox2.Text)
Dim ax1(0 To 2) As Double
Dim ax2(0 To 2) As Double
Dim ax3(0 To 2) As Double
Dim ax4(0 To 2) As Double
ax1(0) = pt(0)
ax1(1) = pt(1)
ax1(2) = pt(2)
ax2(0) = pt(0) + b
ax2(1) = pt(1)
ax2(2) = pt(2)
ax3(0) = pt(0)
ax3(1) = pt(1) + h
ax3(2) = pt(2)
ax4(0) = pt(0) + b
ax4(1) = pt(1) + h
ax4(2) = pt(2)
Dim linea, lineb, linec, lined As AcadLine
Set linea = ThisDrawing.ModelSpace.AddLine(ax1, ax2)
Set lineb = ThisDrawing.ModelSpace.AddLine(ax2, ax3)
Set linec = ThisDrawing.ModelSpace.AddLine(ax3, ax4)
Set lined = ThisDrawing.ModelSpace.AddLine(ax4, ax1)
End Sub
Private Sub UserForm_Initialize()
ComboBox1.AddItem "10*20"
ComboBox1.AddItem "15*30"
ComboBox1.AddItem "20*40"
End Sub
执行以后出现这句提示:实时错误‘-2147217904(80040阿0)’:至少一个参数没有被指定值。 |
|