loki3000
Mechanical
- Sep 29, 2009
- 652
Hello
first of all i must say that i am completely new to abaqus and esp. abaqus python scripting (and python, programming in general too)
the problem is as follows:
i have a very large model that has a number of element sets defined. I have to fetch their names and filter them by their name; the ones of my interes are named such: PART-1-1.ElSet_Coh_1_2 (where 1_2 are variable, rest is as specified).
I am able to get elset as a list (here is an example on a simpler tutorial model)
>>> print asm.instances['PART-1-1'].elementSets.keys()
['CENT', 'ETOP', 'FOAM', 'PMASS', 'UPPER']
but i have no idea of how to filter the list for only the matching ones. i have seen list filtering in diveintopython, but there is nothing like that. regexps maybe?
first of all i must say that i am completely new to abaqus and esp. abaqus python scripting (and python, programming in general too)
the problem is as follows:
i have a very large model that has a number of element sets defined. I have to fetch their names and filter them by their name; the ones of my interes are named such: PART-1-1.ElSet_Coh_1_2 (where 1_2 are variable, rest is as specified).
I am able to get elset as a list (here is an example on a simpler tutorial model)
>>> print asm.instances['PART-1-1'].elementSets.keys()
['CENT', 'ETOP', 'FOAM', 'PMASS', 'UPPER']
but i have no idea of how to filter the list for only the matching ones. i have seen list filtering in diveintopython, but there is nothing like that. regexps maybe?