请各位帮忙看看下面这段简单代码,为什么运行不了啊?运行时说是:当前CAD窗口未显示
Private Sub cmdadd_Click() For n = 0 To (List1.ListCount - 1) If List1.Selected(n) = True Then Text1.Text = Text1.Text & vbCrLf & List1.List(n) End If Next End Sub
Private Sub cmdclose_Click() Unload Me End Sub
Private Sub Cmdopen_Click() List1.Clear CommonDialog1.FONTNAME = "" CommonDialog1.Flags = 512 CommonDialog1.InitDir = "C:\字库文件" CommonDialog1.Filter = "Text(*.Txt)|*.txt" CommonDialog1.ShowOpen If CommonDialog1.FileName > "" Then Open CommonDialog1.FileName For Input As #1 Do While Not EOF(1) Line Input #1, Mydata List1.AddItem Mydata Loop Close #1 End If End Sub
(出差就在下面这段里) Private Sub cmdwrite_Click() Dim WordObj As AcadMText Dim startPnt As Variant Dim EndPnt As Variant startPnt = ThisDrawing.Utility.GetPoint(, vbCrLf & "输入起点:") EndPnt = ThisDrawing.Utility.GetPoint(startPnt, vbCrLf & "输入止点:") Set WordObj = ThisDrawing.ModelSpace.AddMText(startPnt, EndPnt, Text1.Text) ThisDrawing.Application.ZoomAll End Sub
多谢,多谢... |