If I understand correctly, the nested families already have a Label parameter, but you would like to assign a value to a family if it is nested. The FamilyInstance class has a GetSubcomponentIds() method, which is probably what you are looking for. This will be slightly more complicated if you have multiple levels of nesting, but it is still feasible. Likewise, each FamilyInstance has a SuperComponent property which will help you determine if you are at the highest point in the family’s hierarchy (i.e. it is not itself a nested component).