I encounter the problem in using getByBoundingBox command in ABAQUS. I tried to select particular edges by using for loop but it did not work properly.
I am writing Python scripts to generate lattice models using beam elements in ABAQUS. I have managed to design lattice structure. My design involves two distinct edges such as joints and rods for each strut. Red edges in the attached image represents the rod portions of the struts. My next aim is to create sets for joint and rod edges. I have tried to use getByBoundingBox command in ABAQUS.
When I select all the volume of my lattice, all struts are selected and set is arranged as called 'ALL-STRUTS' as below.
p = mdb.models['Model-1'].parts['lattice']
e = p.edges
edge_all = e.getByBoundingBox(xMin=-Luc,yMin=-Luc,zMin=-Luc,
xMax=(NoS[0]+1)*Luc,yMax=(NoS[1]+1)*Luc,zMax=(NoS[2]+1)*Luc*AR)
p.Set(edges=edge_all, name='ALL-STRUTS')
But when I tried to use for loop to select the joint portions by defining the boxes, the joint edges are not selected and it would be empty. I am not sure where I am doing mistake. My script is as below:
for ii in range(0,2*NoS[0]+1,1):
distance = 1e-2
# edge detecting
edge_joints = e.getByBoundingBox(xMin=ii*Luc/2-distance,yMin=-Luc,zMin=-Luc*AR,
xMax=ii*Luc/2+distance,yMax=(NoS[1]+1)*Luc,zMax=(NoS[2]+1)*Luc*AR)
# edge lists
p.Set(edges=edge_joints, name='JOINTS')type here
(Luc: unit cell size // NoS(x,y,z) defines stacking the unit cell spatially // AR for aspect ratio of the unit cell) (I have tried to define the boxes that selected the joint portion of the struts.)
If I can solve this issue, the similar method will be applied for rod portion and eventually I plan to arrange particular number of division at these set edges.
Thanks for contribution and help. Mesut