明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1696|回复: 0

求助:compile error can't find project or library

[复制链接]
发表于 2009-12-17 11:15 | 显示全部楼层 |阅读模式

Private Sub cmdCreate_Click()
  Dim CADAppobj As AcadApplication
  Dim CADDocument As AcadDocument
  Dim LayerObj As AcadLayer
  Dim PointObj As AcadPoint
  Dim TextObj As AcadText
  Dim Location(0 To 2) As Double
  Dim textPoint(0 To 2) As Double
  Dim sysVarName As String
  Dim sysVarData As Integer
  Dim strSQL As String
  Dim strFile As String
  Dim strName As String
  Dim rs As ADODB.Recordset
  Dim rsType As ADODB.Recordset
  Dim I As Integer
  Dim J As Integer
 
  On Error GoTo EndForm
  If m_CurLandType <> 0 Then
    '创建文件
    Screen.MousePointer = vbHourglass
    DoEvents
   
    strName = cboLandType.Text & "样点"
'    strFile = App.Path & "\" & strName & ".dwg"
    Set CADAppobj = New AcadApplication
    CADAppobj.Documents.Close
    Set CADDocument = CADAppobj.Documents.Add
   
    Set LayerObj = CADDocument.Layers.Add(strName)
    CADDocument.ActiveLayer = LayerObj
    CADDocument.Activate
    sysVarName = "PDMODE"
    sysVarData = 2
    CADDocument.SetVariable sysVarName, sysVarData
    SetForegroundWindow Me.hwnd
    SetAPIFocus Me.hwnd
   
    '写入数据
    J = 1
    pBar.Max = 1
    strSQL = "Select * From Ext_Type_Define Where Table_ID=1"
    Set rsType = m_Cnn.Execute(strSQL)
    Do While Not rsType.EOF
      strSQL = "Select Samples_ID,Sam_Code,Sam_CoordX,Sam_CoordY From Samples_" & _
                rsType!Type_ID & " Where Land_Type_ID=" & m_CurLandType & " Order by Samples_ID"
      Set rs = m_Cnn.Execute(strSQL)
      pBar.Max = rs.RecordCount + pBar.Max
      rsType.MoveNext
    Loop
   
    rsType.MoveFirst
    Do While Not rsType.EOF
      strSQL = "Select Samples_ID,Sam_Code,Sam_CoordX,Sam_CoordY From Samples_" & _
                rsType!Type_ID & " Where Land_Type_ID=" & m_CurLandType & " Order by Samples_ID"
      Set rs = m_Cnn.Execute(strSQL)
      For I = 1 To rs.RecordCount
        If Not IsNull(rs!Sam_CoordX) And Not IsNull(rs!Sam_CoordY) Then
          Location(0) = rs!Sam_CoordX
          Location(1) = rs!Sam_CoordY
          Location(2) = 0
          Set PointObj = CADDocument.ModelSpace.AddPoint(Location)
          PointObj.Color = acRed
         
          textPoint(0) = Location(0) + 25
          textPoint(1) = Location(1) - 28
          textPoint(2) = 0
          Set TextObj = CADDocument.ModelSpace.AddText(CStr(rs!sam_Code), textPoint, 50)
          TextObj.Color = acGreen
        End If
        pBar.Visible = True
        pBar.Value = pBar.Value + 1
        Label3.Visible = True
        Label3.Caption = "已转出:" & J & "个样点"
        J = J + 1
        rs.MoveNext
      Next I
     
      rsType.MoveNext
    Loop
     
     
    MsgBox "共转出" & J - 1 & "个样点", vbInformation, "提示"
    
    CADDocument.SaveAs Text2.Text
    txtCreate.Text = txtCreate.Text & "成功创建" & Text2.Text & vbCrLf
    CADAppobj.Quit
    DoEvents
    Screen.MousePointer = vbDefault
  End If
  Exit Sub
EndForm:
  txtCreate.Text = txtCreate.Text & "!ERROR 失败创建" & strFile & vbCrLf & "Record=" & J
End Sub

提示:compile error can't find project or library错误怎么解决,我是菜鸟,请高手指点。

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-21 05:26 , Processed in 0.215724 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表