Probably the easiest way would be to do this:
Add your objects in different layers to two families. For example, put Layer 1 objects into Family Yellow, and Layer 2 objects into Family Blue.
Now, in events:
When Player is on Layer 1
-> Remove attribute from Blue: "Solid"
-> Add attribute for Yellow: "Solid"
When Player is on Layer 2
-> Remove attribute from Yellow: "Solid"
-> Add attribute for Blue: "Solid"