|
发表于 2002-10-26 14:55:00
|
显示全部楼层
函数如下:
'删除块引用
Public Sub DeleteBlockRef(ByVal Name As String)
Dim EntObj As AcadEntity
On Error GoTo ErrTrap
If Name = "" Then Exit Sub
For Each EntObj In ThisDrawing.ModelSpace
If StrComp(EntObj.ObjectName, "AcDbBlockReference", vbTextCompare) = 0 Then
If StrComp(EntObj.Name, Name, vbTextCompare) = 0 Then
EntObj.Delete
End If
End If
Next
Set EntObj = Nothing
Exit Sub
ErrTrap:
If Not (EntObj Is Nothing) Then Set EntObj = Nothing
On Error GoTo 0
End Sub |
|