插入失败
Private Sub CommandButton6_Click()Dim i&
Dim insertionPnt(0 To 2) As Double
Dim blockRefObj As AcadBlockReference
Dim blockRefObj1 As AcadBlockReference
Dim Obj1 As Object
On Error Resume Next
insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "C:\Program Files (x86)\AutoCAD 2007\块.dwg", 1#, 1#, 1#, 0)’在第二个dwg文档内插入失败。除非关闭所有CAD。
For Each Obj1 In ThisDrawing.ModelSpace
If Obj1.Name = "块" Then Obj1.Delete
Next
Set blockRefObj = Nothing
CR:
i = i + 1
Set blockRefObj1 = ThisDrawing.ModelSpace.InsertBlock(ThisDrawing.Utility.GetPoint, "超级数据拾取", 1#, 1#, 1#, 0)
Dim varAttributes As Variant
varAttributes = blockRefObj1.GetAttributes
varAttributes(0).TextString = i & "#"
If CheckKey(VK_ESCAPE) = True Then
varAttributes(0).TextString = i - 1 & "#"
Exit Sub
End If
'If CheckKey(VK_SHIFT) = True Then
GoTo CR
'End If
End Sub
http://bbs.mjtd.com/xwb/images/bgimg/icon_logo.png 该贴已经同步到 尼玛的臭屌丝的微博 第二次插入不需要路径和".dwg",即
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "块", 1#, 1#, 1#, 0)
页:
[1]