When I want Altium to ignore clearance on several objects, I just quickly add them to the Component Clearance queries, like:
First Object Matches -
(Name <> 'S1') And (Name <> 'D1')
Second Object Matches -
(Name <> 'S1') And (Name <> 'D1')
Basically, that just means when the first and second objects are not S1 and not D1... then do the normal component clearance check (otherwise don't do any clearance check). It still does electrical checks, so it'll catch a short circuit or any other rule you have.
Typically, when I want to do this, it's to make the PCB compatible with multiple footprints in the same spot, like an MCU with a DIP and SOP package... or in this example, an I/O that can be populated with an SMT switch or LED.
Obviously you need to be careful with those objects, since collisions between all objects in the list will be ignored... like for example if I added S2 and D2 to the list, then collisions between D1 and D2 would be ignored, even though I really just wanted S1/D1, and S2/D2 (you could make more complex rules to handle that, but it's never been a big deal to me). Collisions with other objects (i.e. D1 and R1) will still be caught.