Author Topic: Selectionset Woes  (Read 630 times)

0 Members and 1 Guest are viewing this topic.

Swift

  • Swamp Rat
  • Posts: 595
Selectionset Woes
« on: September 18, 2016, 02:50:08 pm »
Greetings All,

Been a long time. I apologize before hand for not posting a snippet, but I riding shotgun down the interstate, trying to write some vba. So I'm posting from my phone.

What I'm trying to do is set a selectionset by window or fence, process the selection set then reset the selection set window for different items.

The problem is that after the initial selection I can never select anything else. I've tried clearing the selectionset, deleting it, set it to nothing and reseting in my outside loop but I can't get it to ever select anything on the second iteration of the loop.

I'm wondering if I've hit a hidden vba feature?

Thoughts?


jouni

  • Mosquito
  • Posts: 1
Re: Selectionset Woes
« Reply #1 on: November 28, 2016, 08:43:10 am »
Try this method:

On Error Resume Next
        Set selSet = myDoc.SelectionSets.Add("Objects")
        If Err.Number <> 0 Then
       
            myDoc.SelectionSets.Item("Objects").Delete
            Set selSet = myDoc.SelectionSets.Item("Objects")
            selSet.Clear
        End If
       
selSet.Clear
selSet.SelectOnScreen
selSet.Highlight True

.
.
.
selSet.Highlight False
        selSet.Clear
        selSet.Delete