Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to remove an entire cell of a part automatically in ABAQUS?

Status
Not open for further replies.

CADlalala

Aerospace
Apr 3, 2014
43
Hi,

I am trying to write an script to remove cells in a part if the cell volume is smaller than a given value.
Is there a simple command to delete a cell?

This is what I have tried:

def sliverVolumes(modelName, pInterName):
#Class to keep only cells bigger than a certain minimum value 'paramVol': paramVol=volCell/part_volume_r
allCells = pInterName.cells
mask_r = pInter.cells.getMask();
cellobj_sequence_r = pInter.cells.getSequenceFromMask(mask=mask_r);
part_volume_r = pInterName.getVolume(cells=cellobj_sequence_r);
# get faces
for i in range(0, len(allCells)):
volCell = allCells.getSize()
paramVol = volCell / part_volume_r
print 'paramVol= '+str(paramVol)
if paramVol < 0.01:
print 'Sliver Volume'
#HOW CAN I DELETE THE CELL HERE???
else:
print 'Not a sliver Volume'


Thanks!
 
Replies continue below

Recommended for you

Try using the boolean operations available in the assembly module. You can merge/subtract volumes to generate a modified part then delete the old ones.
 
Hi Cooken,
I do not think that the boolean operations are an option, at least when it comes to automation. I simply want to delete small sliver volumes like the one below:
sliver_q1wysn.png
 
Remove faces? This will automatically delete the affected cells.

Also there is an option in part copy to separate disconnected regions into parts..?
 
Thanks Cooken, What would be the command for removing all the faces of a particular cell?

def sliverVolumes(modelName, pInterName):
#Class to keep only cells bigger than a certain minimum value 'paramVol': paramVol=volCell/part_volume_r
allCells = pInterName.cells
mask_r = pInter.cells.getMask();
cellobj_sequence_r = pInter.cells.getSequenceFromMask(mask=mask_r);
part_volume_r = pInterName.getVolume(cells=cellobj_sequence_r);
# get faces
for i in range(0, len(allCells)):
volCell = allCells.getSize()
paramVol = volCell / part_volume_r
print 'paramVol= '+str(paramVol)
if paramVol < 0.01:
print 'Sliver Volume'
#REMOVE ALL FACES OF THE SLIVER CELL
else:
print 'Not a sliver Volume'
 
If is a separate cell like on the picture, then it is simple. Check all cells and if the cell is too small, ask for the attached faces and then use them in this command form the Geometry Edit option:

p.RemoveFaces(faceList = f[0:6], deleteCells=False)
 
^ That.

You can perform the action in CAE, then check the .rpy file to retrieve the python command and manipulate into a parameterized/automated script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor