- 积分
- 773
- 明经币
- 个
- 注册时间
- 2005-5-8
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
Attribute VB Name = "Form3" Attribute VB GlobalNameSpace = False Attribute VB Creatable = False Attribute VB PredeclaredId = True Attribute VB Exposed = False Dim acadapp As AcadApplication 'ACAD对象
Private Sub Command1 Click() Dim returnobj As AcadObject Dim basepnt As Variant Dim I As Integer
Dim Name As String Set acadapp = GetObject(, "AutoCAD.application") 'On Error Resume Next 'Dim ssetobj As AcadSelectionSet 'Set ssetobj = acadapp.ActiveDocument.SelectionSets.Add("Test1") AppActivate acadapp.Caption '激活AutoCAD窗口
RETRY: For I = 1 To 5 Select Case I Case 1 Name = "房间号" Case 2 Name = "房间名称" Case 3 Name = "负责人" Case 4 Name = "面积" Case 5 Name = "类别" End Select 'roomNo = acadapp.ActiveDocument.Utility.GetString(1, vbCrLf & "请输入房间号:") 'If roomNo = "" Then Exit Sub 'acadapp.ActiveDocument.Utility.GetEntity returnobj1, basepnt1, "请选择 房间号 " 'If Err <> 0 Then Exit Sub 'acadapp.ActiveDocument.Utility.GetEntity returnobj2, basepnt2, "请选择 房间名称 " 'If Err <> 0 Then Exit Sub 'acadapp.ActiveDocument.Utility.GetEntity returnobj3, basepnt3, "请选择 负责人 " 'If Err <> 0 Then Exit Sub 'acadapp.ActiveDocument.Utility.GetEntity returnobj4, basepnt4, "请选择 面积 " 'If Err <> 0 Then Exit Sub '等待用户从屏幕上选择实体对象 acadapp.ActiveDocument.Utility.GetEntity returnobj, basepnt, "请选择" + Name
If Err <> 0 Then Err.Clear Form1.Show R.Close c.Close Set c = Nothing Set R = Nothing Exit Sub Else '根据图形的文字改数据库的数据 '----------------------------- Set db = Workspaces(0).OpenDatabase(App.Path + "\zsw", False) Set rst = db.OpenRecordset("2000", dbOpenTable) rst.AddNew rst.Fields(Name) = returnobj.TextString rst.Update rst.Close db.Close Set rst = Nothing Set db = Nothing '---------------------------- End If Next I GoTo RETRY R.Close c.Close Set c = Nothing Set R = Nothing End Sub
开头的attribute就显示有错,attribute是什么意思啊!大家发表一下意见吧! |
|