- 积分
- 684
- 明经币
- 个
- 注册时间
- 2003-4-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2005-1-18 08:45:00
|
显示全部楼层
带属性的块组码是2,名称是块的名称,示例:
这是我在图形中快速查找“GUANKOUHAO”和“GUANKOUBIAO”的属性块,并在找到后删除的一段模块。
Dim ssets As AcadSelectionSet Dim EntObj As AcadObject Dim gpCode(3) As Integer Dim dataValue(3) As Variant Dim groupCode As Variant, dataCode As Variant Dim N As Integer Dim varAtt As Variant On Error Resume Next Set ssets = DOCobj.SelectionSets("ZZPset") If Err Then Err.Clear Set ssets = DOCobj.SelectionSets.Add("ZZPset") End If ssets.Clear gpCode(0) = -4: gpCode(1) = 2: gpCode(2) = 2: gpCode(3) = -4 dataValue(0) = "<OR": dataValue(1) = "GuanKouBiao": dataValue(2) = "GuanKouHao": dataValue(3) = "OR>" groupCode = gpCode dataCode = dataValue ssets.Select acSelectionSetAll, , , groupCode, dataCode For N = 0 To ssets.Count - 1 Set EntObj = ssets.Item(N) varAtt = EntObj.GetAttributes If varAtt(0).TextString = "管口号" Then ElseIf varAtt(0).TextString = GKHname Then EntObj.Delete End If Next N Set EntObj = Nothing ssets.Delete End Sub
|
|