Find which parameter a nested family is linked to

hello, I have visibility parameters linked to nested family elements that make them show up, or not, in the project. I need to set a different parameter of the parent family to each one of these elements based on its location in the project, in sequential order. However, I cant set the right parameter without knowing which nested family is connected to which host parameter. Does that make sense? Is there any way to query what parameters a nested family has linked to it from its parent family?