TheSwamp

Code Red => VB(A) => Topic started by: Swift on September 18, 2016, 02:50:08 PM

Title: Selectionset Woes
Post by: Swift 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?

Title: Re: Selectionset Woes
Post by: jouni 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