'重命名图块
Sub ReNameBLock()
On Error Resume Next
Dim E As AcadEntity
Dim P As Variant
Dim B As AcadBlockReference
ThisDrawing.Utility.GetEntity E, P, "选择一个你要重命名的参照块: "
If Err <> 0 Then Exit Sub
Dim NewName As String
NewName = InputBox("输入新的图块名称:", "田草结构工具箱")
If NewName = "" Then Exit Sub
If Err = 0 Then
If E.ObjectName = "AcDbBlockReference" Then
Set B = E
ThisDrawing.Blocks(B.name).name = NewName
End If
End If
End Sub
Sub ReNameBLock()
On Error Resume Next
Dim E As AcadEntity
Dim P As Variant
Dim B As AcadBlockReference
ThisDrawing.Utility.GetEntity E, P, "选择一个你要重命名的参照块: "
If Err <> 0 Then Exit Sub
Dim NewName As String
NewName = InputBox("输入新的图块名称:", "田草结构工具箱")
If NewName = "" Then Exit Sub
If Err = 0 Then
If E.ObjectName = "AcDbBlockReference" Then
Set B = E
ThisDrawing.Blocks(B.name).name = NewName
End If
End If
End Sub
[本日志由 tiancao1001 于 2009-07-15 03:44 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |