If objdoc.FullName <> dwgname Then objdoc.Open dwgname End If objacad.Visible = True
End Sub
Private Sub txtUse_click() MsgBox "this box cannot be edited" End Sub
Private Function checkallfilled() As Boolean Dim chkstr As String checkallfilled = False chkstr = Trim(txtLSH.Text & txtName.Text & txtPzwh.Text & txtPzwh2.Text & txtDate.Text & txtPzwh3.Text & txtPosition.Text) If (chkstr <> "") Then checkallfilled = True End If End Function
'获取文件句柄 Private Function gethandle() As String
Dim utilobj As Object Dim pnt Dim temppoint(0 To 2) As Double Dim point(0 To 2) As Double Dim pointl Dim sset As Object
'出错处理 On Error GoTo error_gethandle Set utilobj = objacad.ActiveDocument.Utility pnt = utilobj.GetPoint(, "选择一个CAD对象连接记录:")
'获取选择集对象 Set sset = objacad.ActiveDocument.SelectionSets.add("ss1") Call sset.SelectAtPoint(point) If sset.Count = 1 Then If StrComp(sset(0).EntityName, "acdbblockreference", 1) = 0 Then gethandle = sset(0).Handle Else MsgBox "没有图块被选中" gethandle = "" End If Else If sset.Count = 0 Then Form1.Hide MsgBox "没有图块被选中" Form1.Show End If If sset.Count > 1 Then MsgBox "选中图块超过一个" End If gethandle = "" End If Exit Function