Creating sets using the Python API
Creating sets using the Python API
(OP)
I created a simple box and meshed it & I would like to create 2 sets one that contains the central elements & a second that contains all the surrounding elements.
I can calculate quite trivially which elements I want in each set but I'm having problems creating the sets. I created a few sets in CAE and then inspected the *.jnl files to find the method but I just don't understand what I'm seeing, for instance,
The above is what I get when I manually select elements in the CAE window, the numbers in no way match up with the element numbers that I picked.
I've been pouring over the Reference Manual but so far cant find a set generator method where I can just list the element numbers. I'm pretty sure there is one though.
Thanks
I can calculate quite trivially which elements I want in each set but I'm having problems creating the sets. I created a few sets in CAE and then inspected the *.jnl files to find the method but I just don't understand what I'm seeing, for instance,
CODE --> python
mdb.models['Model-1'].parts['Part-1'].Set(elements=mdb.models['Model-1'].parts['Part-1'].elements.getSequenceFromMask(mask=('[#0:10 #4 #0:3 #12 ]', ), ), name='Set-1') The above is what I get when I manually select elements in the CAE window, the numbers in no way match up with the element numbers that I picked.
I've been pouring over the Reference Manual but so far cant find a set generator method where I can just list the element numbers. I'm pretty sure there is one though.
Thanks





RE: Creating sets using the Python API
Place the code below in a abaqus_v6.env, restart /CAE and create the set again. Now your .rpy file should look a bit different.
CODE
def onCaeStartup(): session.journalOptions.replayGeometry session.journalOptions.setValues(replayGeometry=INDEX)RE: Creating sets using the Python API
RE: Creating sets using the Python API
RE: Creating sets using the Python API
I just tried that but it hasnt change the output in the *.jnl file. Its still using 'elements.getSequenceFromMask'
RE: Creating sets using the Python API
RE: Creating sets using the Python API
RE: Creating sets using the Python API
CODE --> Python
Which gives the following error,
TypeError: too many arguments; expected 1, got 4
So I tried,
CODE --> Python
Which gave the error,
TypeError: arg1; found tuple, expecting int
So then I tried,
CODE --> Python
Which gave the following error,
TypeError: elements; found MeshElement, expecting tuple
Puzzling...
RE: Creating sets using the Python API
RE: Creating sets using the Python API
RE: Creating sets using the Python API
eg number of elements, how to access lists of elements in each set etc
RE: Creating sets using the Python API