how to get index of variables and constraints

Do you mean, Which of the elements of set time appear together with device B on a constraint or variable ?