What's the best way to locate all objects that don't have a particular qualifier?
This is an issue I've come up against a number of times. In the specific situation I'm in now, it looks like this: I have a whole bunch of objects with Qualifer A. Many (but not all) of those objects also have Qualifier B. I want to isolate all objects that do have qualifier A but don't have qualifier B, and move them to a different layer. So Objects that have A & B should stay where they are, while objects that are only A should move layers.
It would be really nice if we could have a (negatable) condition that can test for whether a particular object has a particular qualifier or not (hint hint, @Yves ). But I don't think we can at the moment, so I've come up with the following solution which works ok, but I don't like it. It's cumbersome and surely not very performant:
step 1: I first record the current layer of ALL objects with qualifier A.
step 2: Then I move ALL objects that have qualifier A to a different layer.
step 3: Then I check whether those objects which have a qualifier of A also have a qualifier of B (using the only way I know how - by checking to see whether the fixed value of an A object is also the fixed object of a B object). If so, then I move that object back to the layer it was originally on (because steps 1 and 2 turned out to be unnecessary for that object, so I need to undo them).
Is there a better method than this for testing whether or not an object has (or doesn't have) a particular qualifier? There are many programmers here who area smarter than me, so I'm hoping that there is a more straight-forward they can show me that I just haven't thought of.