'========如果有属性修改任务========= '=================================== '=================================== DoEvents fileright = False If Check7.Value = 1 Then If dwgfile.ActiveSpace = acModelSpace Then For Each obj In dwgfile.ModelSpace cadmessage.Label7.Caption = "正在进行属性修改: 查找目标块块 " & mainblock & " 当前 " & obj.ObjectName
If obj.ObjectName = "AcDbBlockReference" Then If obj.Name = mainblock Then fileright = True cadmessage.Label7.Caption = "正在进行属性修改: 已找到 " & mainblock & " 当前正属性修改中。。。" objatts = obj.GetAttributes For m = LBound(objatts) To UBound(objatts) For n = 0 To Combo6.ListCount - 1 If objatts(m).TagString = Combo6.List(n) Then If Combo8.List(n) <> "" Then If Combo8.List(n) = "null" Or Combo8.List(n) = "NULL" Then objatts(m).TextString = "" Exit For Else objatts(m).TextString = Combo8.List(n) Exit For End If End If End If Next n Next m End If End If Next obj End If
If dwgfile.ActiveSpace = acPaperSpace Then For Each obj In dwgfile.PaperSpace cadmessage.Label7.Caption = "正在进行属性修改: 查找目标块块 " & mainblock & " 当前 " & obj.ObjectName If obj.ObjectName = "AcDbBlockReference" Then If obj.Name = mainblock Then fileright = True cadmessage.Label7.Caption = "正在进行属性修改: 已找到 " & mainblock & " 当前正属性修改中。。。" objatts = obj.GetAttributes For m = LBound(objatts) To UBound(objatts) For n = 0 To Combo6.ListCount - 1 If objatts(m).TagString = Combo6.List(n) Then If Combo8.List(n) <> "" Then If Combo8.List(n) = "null" Or Combo8.List(n) = "NULL" Then objatts(m).TextString = "" Else objatts(m).TextString = Combo8.List(n) End If End If End If Next n Next m End If End If Next obj End If End If