Selection set using filter with VBA

Selection set using filter with VBA

Anonymous
Not applicable
3,275 Views
4 Replies
Message 1 of 5

Selection set using filter with VBA

Anonymous
Not applicable
Hi
I am trying on AcadMAP VBA for selection set with filter using 'SelectOnScteen' request. I tried to copy the syntax from the code. But it didn't work. It Says 'Invalid FilterType'. Required HELP On this Topic.

Thanx

Sudhir Ogale
0 Likes
3,276 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
It should work. Can you please paste your code that
gives error?

 

Murali


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi

I am trying on AcadMAP VBA for selection set with filter using
'SelectOnScteen' request. I tried to copy the syntax from the code. But it
didn't work. It Says 'Invalid FilterType'. Required HELP On this Topic.

Thanx

Sudhir Ogale

0 Likes
Message 3 of 5

Anonymous
Not applicable
HI MURALI THANX FOR REPLY,

HERE IS THE CODE.



Private Sub CommandButton13_Click()
Me.Hide
Dim FilterType As Integer
Dim FilterData As String

Dim sset As AcadSelectionSet
Dim ent As AcadEntity
Dim name As String
'Dim sset As AcadSelectionSet
FilterType = 8
FilterData = "Vill_bnd"

Set sset = ThisDrawing.SelectionSets.add("ss1")
sset.SelectOnScreen FilterType, FilterData

For Each ent In sset
name = ent.ObjectName
MsgBox name
Next
sset.Delete
MsgBox "completed"
Me.Show
End Sub

WAITING FOR UR SOLUTION

THANX
BYE
SUDHIR
0 Likes
Message 4 of 5

Anonymous
Not applicable
Hi,

 

Here is some working code to select arcs. 
You'll notive the Dim commands are different from yours

 

Dim FilterType(0)    As
Integer
Dim FilterData(0)    As Variant
Dim ssArcs As
AcadSelectionSet
    FilterType(0) = 0: FilterData(0) =
"ARC"
    Set ssArcs =
ThisDrawing.SelectionSets.Add("SSET")
   
Me.Hide
    ssArcs.SelectOnScreen FilterType, FilterData 
' this selects arcs

--
Regards

 


 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
HI
MURALI THANX FOR REPLY,

HERE IS THE CODE.



Private Sub CommandButton13_Click()
Me.Hide
Dim FilterType As
Integer
Dim FilterData As String

Dim sset As AcadSelectionSet
Dim ent As AcadEntity
Dim name As
String
'Dim sset As AcadSelectionSet
FilterType = 8
FilterData =
"Vill_bnd"

Set sset = ThisDrawing.SelectionSets.add("ss1")
sset.SelectOnScreen
FilterType, FilterData

For Each ent In sset
name = ent.ObjectName
MsgBox name
Next

sset.Delete
MsgBox "completed"
Me.Show
End Sub

WAITING FOR UR SOLUTION

THANX
BYE
SUDHIR

0 Likes
Message 5 of 5

Anonymous
Not applicable
Thanks Laurie
The given code is working
thanks again.

sudhir
0 Likes