简单的方法就用 VBA 将 匿名块 转换为 有名块 这样就可以编辑了。
'重命名图块
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
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |