I created an abaqus model with different parts and each part has the same node numbering. I'm trying to make a set that contains all nodes with labale of 180. I wrote this loop but it takes just the the last part's node. How can I correct this script to take all nodes with label of 180 from all parts?
for j in range(1,n):
mdb.models['Model-1'].rootAssembly.SetFromNodeLabels(nodeLabels=(('part-'+str(j), (180, )), ), name='SETofNode180')
Through every iteration of the for loop a new node set is created and overwrites any existing node set. That's why you're only seeing one node set which contains a single node from the last part in your list.
You should construct a list of node labels separately and then call SetFromNodeLabels
once, passing it a list of all the node labels.
nodeLabels = []
for j in range(1,n):
nodeLabels.append( ('part-'+str(j), (180, )) )
mdb.models['Model-1'].rootAssembly.SetFromNodeLabels(nodeLabels=nodeLabels, name='SETofNode180')