[转载]AutoCAD VBA程序---批量插入块源代码
(2017-05-07 10:11:52)
标签:
转载 |
分类: CAD |
原文地址:AutoCAD VBA程序---批量插入块源代码 作者:GIS广益
Option Explicit
PrivateSub cmdClear_Click()
Me.lstFile.Clear
EndSub
PrivateSub cmdDelete_Click()
If lstFile.ListCount >= 1 Then
If lstFile.ListIndex = -1 Then
MsgBox "请选择列表中的图形名称!", vbExclamation, Me.Caption
Exit Sub
End If
lstFile.RemoveItem (lstFile.ListIndex)
End If
EndSub
PrivateSub cmdInsert_Click()
Dim i As Integer
Dim pntX(0 To 2) As Double
With Me
pntX(0) = 0#: pntX(1) = 0#: pntX(2) = 0#
If .lstFile.ListCount = 0 Then Exit Sub
.pbInsert.Value = 0
.pbInsert.Max = .lstFile.ListCount
For i = 0 To .lstFile.ListCount - 1
.lstFile.ListIndex = i
ThisDrawing.Application.ActiveDocument.ModelSpace.InsertBlock pntX, .lstFile.List(i), 1, 1, 1, 0
.pbInsert.Value = .pbInsert.Value + 1
Next i
MsgBox "批量插入块完毕。", vbInformation, .Caption
Unload Me
End With
EndSub
PrivateSub cmdOpen_Click()
Dim i As Integer
Dim Y As Integer
Dim Z As Integer
Dim fileNames() As String
On Error GoTo errHandle
With comDlg
Private
End
Private
End
Private
End
Private

加载中…