'Select certain amount of nodes using getbyboundingcylinder in abaqus

I created a loop with Abaqus Python in which I create several nodesets using the following code;

# Set parameters to create a cylinder
r2 = 2  # Radius of screw [mm] # Creating a cylinder around the screw points and reference point
s1 = float(Point1[0]), float(Point1[1]), float(Point1[2])  # Starting point of screw [x,y,z]
s2 = float(Point2[0]), float(Point2[1]), float(Point2[2])  # End point of screw [x,y,z]
ScrewsCylinder = []
Names = []

for i in range(len(root)):
# Create set of cylinders
    ScrewsCylinder.append(mdb.models[modelname].rootAssembly.Set(name='Screw' + str(Names), nodes=[
        mdb.models[modelname].rootAssembly.instances[AllNames[i]].nodes.getByBoundingCylinder(s1, s2, r2), ], ))

What this basically does is create a cylinder and select about 10-18 nodes per instance. I would like to create new sets based on that contain the first three nodes of each set. Is there an easy option to do so? I am a little lost. Thank you!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source