Filtered On Screen Selection

Filtered On Screen Selection

Anonymous
Not applicable
215 Views
2 Replies
Message 1 of 3

Filtered On Screen Selection

Anonymous
Not applicable
I am in the process of learning Visual Basic. In the small routine below I want to select, on screen, all objects desired except paperspace viewports. However, it does not work. Specifically, it says the arguments for "SelectOnScreen" are incorrect. What am I doing wrong?

Sub SelectOS()
Dim ss1 As AcadSelectionSet
Set ss1 = ThisDrawing.SelectionSets.Add("sset")
Dim FilterType(1) As Integer
Dim FilterData(1) As Variant
FilterType(0) = -4
FilterData(0) = "!="
FilterType(1) = 0
FilterData(1) = "PViewport"
ss1.SelectOnScreen FilterType, FilterData
End Sub
0 Likes
216 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Try this instead:

Sub SelectOS()
Dim ss1 As AcadSelectionSet
Dim FilterType(0) As Integer, FilterData(0) As Variant

Set ss1 = ThisDrawing.SelectionSets.Add("sset2")
FilterType(0) = 0: FilterData(0) = "~VIEWPORT"
ss1.SelectOnScreen FilterType, FilterData
End Sub

--
"If you want to be somebody else change your mind"
http://www.acadx.com
http://vbxtender.sourceforge.net
0 Likes
Message 3 of 3

Anonymous
Not applicable
What do you want "!=" for, and group -4, it
works only with (ssget), LISP

 

Select everything, then remove from your selection
set, all Vport:

 

    If sset.count > 0
Then
        For Each ent In
sset
            If
TypeName(ent) <> "IAcadPViewPort"
Then
               
sset.RemoveItems
ent
            End
If
        Next
    End
If

 

 

Hope this helps.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
am in the process of learning Visual Basic. In the small routine below I want
to select, on screen, all objects desired except paperspace viewports.
However, it does not work. Specifically, it says the arguments for
"SelectOnScreen" are incorrect. What am I doing wrong?

Sub SelectOS()
  Dim ss1 As AcadSelectionSet

  Set ss1 = ThisDrawing.SelectionSets.Add("sset")

  Dim FilterType(1) As Integer
  Dim FilterData(1)
As Variant
  FilterType(0) = -4
  FilterData(0) =
"!="
  FilterType(1) = 0
  FilterData(1) =
"PViewport"
  ss1.SelectOnScreen FilterType, FilterData
End
Sub

0 Likes