- 积分
- 3531
- 明经币
- 个
- 注册时间
- 2003-4-11
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2003-10-20 14:06:00
|
显示全部楼层
版主:
我在VB中运行这个:
Sub krSwap()
Set ssetObj = AcadDoc.SelectionSets.Add("SSET")
Dim ArrayData As Variant
Dim mode As Integer
Dim FilterType(5) As Integer
Dim FilterData(5) As Variant
FilterType(0) = -4
FilterData(0) = "<OR"
FilterType(1) = 0
FilterData(1) = "MTEXT"
FilterType(2) = 0
FilterData(2) = "TEXT"
FilterType(3) = 0
FilterData(3) = "INSERT"
FilterType(4) = 0
FilterData(4) = "ATTDEF"
FilterType(5) = 0
FilterData(5) = "OR>"
Dim acSelectionSetAll As Integer
mode = acSelectionSetAll
ssetObj.Select mode, FilterType, FilterData
Dim ent As Object
Dim j As Integer
For Each ent In ssetObj
With ent
' 发现块参考时,检查其属性
If StrComp(.EntityName, "acdbblockreference", 1) = 0 Then
If .HasAttributes Then
'取得属性值
ArrayData = .GetAttributes
Dim appcount As Integer
For appcount = LBound(ArrayData) To UBound(ArrayData)
If StrComp(ArrayData(appcount).EntityName, "acdbattribute", 1) = 0 Then
ArrayData(appcount).TagString = ReplaceString(ArrayData(appcount).TagString, oldTxt.Text, newTxt.Text)
ArrayData(appcount).TextString = ReplaceString(ArrayData(appcount).TextString, oldTxt.Text, newTxt.Text)
End If
Next appcount
End If
End If
End With
Next ent
End Sub
提示我说:对象‘Select’的方法'IAcadSelectionSet'失败
在创建选择集时出错,该怎么修改呢?
Help me!!!! |
|