Create a set of nodes using Python

Hi everybody,

I want to create a set to apply load on nodes using Python, but it's not working and I got an error saying that my mesh doesn't exist.

Here is the part of my code where I try to create the node set using labels:

simulationModel = mdb.models[model_name]

workpieceAssembly = simulationModel.rootAssembly

instanceNodes = simulationModel.rootAssembly.instances['instace name'].nodes

nodeLable = (1,2,3)

meshNodeObj = instanceNodes.sequenceFromLabels(nodeLabel)

myRegion = regionToolset. Region(nodes= meshNodeObj)

workpieceAssembly.Set(nodes=myRegion, name='set1')


My workpiece is a rectangle 2D and I need to create one set for each node of the the top side. Then I will apply

Concentrated Forces to each set. The other problem is I don't know how to get the right nodes and put then into the set.

Ex: node 1 --> set 1 and so on.

I'll appreciate any help.