Selection set filtering

Selection set filtering

Anonymous
Not applicable
347 Views
6 Replies
Message 1 of 7

Selection set filtering

Anonymous
Not applicable
trying to erase all text or mtext on layer HL-TMP or HL-TMP2. Here is what I am using:

INTcode(0) = -4: VARvalue(0) = " INTcode(1) = 0: VARvalue(1) = "TEXT"
INTcode(2) = 0: VARvalue(2) = "MTEXT"
INTcode(3) = -4: VARvalue(3) = "OR>"
INTcode(4) = -4: VARvalue(4) = " INTcode(5) = 8: VARvalue(5) = "HL-TMP"
INTcode(6) = 8: VARvalue(6) = "HL-TMP2"
INTcode(7) = -4: VARvalue(7) = "OR>"

Set ss1 = ThisDrawing.SelectionSets("Test")
If Err Then
Err.Clear
Set ss1 = ThisDrawing.SelectionSets.Add("Test")
End If
ss1.Clear
ss1.Select acSelectionSetAll, , , INTcode, VARvalue
ss1.Erase

but ss1 doesn't contain anything. Any ideas?
0 Likes
348 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
You need to and the object types with the layers. You're only using or.
Stated logically,
object type is text OR mtext AND layer is "HL-TMP" OR "HL-TMP2"

Here's a link to a function that will help you build filters.
http://www.acadx.com/visualbasic/004.htm
--
----
Ed
----
wrote in message news:4984224@discussion.autodesk.com...
trying to erase all text or mtext on layer HL-TMP or HL-TMP2. Here is what
I am using:

INTcode(0) = -4: VARvalue(0) = " INTcode(1) = 0: VARvalue(1) = "TEXT"
INTcode(2) = 0: VARvalue(2) = "MTEXT"
INTcode(3) = -4: VARvalue(3) = "OR>"
INTcode(4) = -4: VARvalue(4) = " INTcode(5) = 8: VARvalue(5) = "HL-TMP"
INTcode(6) = 8: VARvalue(6) = "HL-TMP2"
INTcode(7) = -4: VARvalue(7) = "OR>"

Set ss1 = ThisDrawing.SelectionSets("Test")
If Err Then
Err.Clear
Set ss1 = ThisDrawing.SelectionSets.Add("Test")
End If
ss1.Clear
ss1.Select acSelectionSetAll, , , INTcode, VARvalue
ss1.Erase

but ss1 doesn't contain anything. Any ideas?
0 Likes
Message 3 of 7

Anonymous
Not applicable
Weird that my message got truncated. Here is what I am trying:

INTcode(0) = 0: VARvalue(0) = "TEXT,MTEXT"
INTcode(1) = 8: VARvalue(1) = "HL-TMP,HL-TMP2"
Set ss1 = ThisDrawing.SelectionSets("Test")
If Err Then
Err.Clear
Set ss1 = ThisDrawing.SelectionSets.Add("Test")
End If
ss1.Clear
ss1.Select acSelectionSetAll, , , INTcode, VARvalue
ss1.Erase
0 Likes
Message 4 of 7

Anonymous
Not applicable
This should work. What leads you to think it isn't?

wrote in message news:4984282@discussion.autodesk.com...
Weird that my message got truncated. Here is what I am trying:

INTcode(0) = 0: VARvalue(0) = "TEXT,MTEXT"
INTcode(1) = 8: VARvalue(1) = "HL-TMP,HL-TMP2"
Set ss1 = ThisDrawing.SelectionSets("Test")
If Err Then
Err.Clear
Set ss1 = ThisDrawing.SelectionSets.Add("Test")
End If
ss1.Clear
ss1.Select acSelectionSetAll, , , INTcode, VARvalue
ss1.Erase
0 Likes
Message 5 of 7

Anonymous
Not applicable
my selection set contains 0 items where it should contain many.
0 Likes
Message 6 of 7

Anonymous
Not applicable
Hmmm, I just tested this and had it dump 299 to the Immediate window.....

Sub sstest()
Dim objSS As AcadSelectionSet
Dim intCode(1) As Integer
Dim varVal(1) As Variant

On Error Resume Next
Set objSS = ThisDrawing.SelectionSets.Add("MySS")
If Err Then
Set objSS = ThisDrawing.SelectionSets.Item("MySS")
End If
Err.Clear

intCode(0) = 0: varVal(0) = "TEXT,MTEXT"
intCode(1) = 8: varVal(1) = "BD,NOS"

objSS.Select acSelectionSetAll, , , intCode, varVal
objSS.Highlight True
Debug.Print objSS.Count

End Sub

wrote in message news:4984347@discussion.autodesk.com...
my selection set contains 0 items where it should contain many.
0 Likes
Message 7 of 7

Anonymous
Not applicable
Using this exact code I am getting an:

Invalid arguement Filter Type in Select

any ideas?
0 Likes