for i in assembly_ref_list: print i listRepresentations = cmds.assembly(i, query=True, listRepresentations=True) print listRepresentations for d in listRepresentations: # 改变装配文件(注意代码有问题,现在相当于全部切换一遍) sel_item = cmds.assembly(i, edit=True, activeLabel=d) print sel_item