Bars visibility

Hi everybody

I have a request for create a “tool” to make “not visible” the rebars when the host is hide or not visible.

If I hide a host in a view (first view), i.e. slab when I want detail only the bars of a beam, if I work in a second view and I put some bars into the slab, when I return to the first one I view the bars of the slab while the the slab is hide.

Is it possible to have a command that chek if the host is hide and when the host is hide make the rebars hide too.

Thanks
bye