Scripting: Create a set encompassing all edges of a part
Scripting: Create a set encompassing all edges of a part
(OP)
Hi
I've written a script that imports polygonial 2D parts, creates the instances of them, seeds and meshes them.
Next step is to get a handle on the nodes that are on the edges of the part.
Is there a way to script: "Get all edges of part X; add them to set Y"?
I can do this manually, but I'm drawing a blank when trying to formulate it in a way that can be scripted for multiple parts and models.
Any ideas?
Thanks in advance
R. Mettier
I've written a script that imports polygonial 2D parts, creates the instances of them, seeds and meshes them.
Next step is to get a handle on the nodes that are on the edges of the part.
Is there a way to script: "Get all edges of part X; add them to set Y"?
I can do this manually, but I'm drawing a blank when trying to formulate it in a way that can be scripted for multiple parts and models.
Any ideas?
Thanks in advance
R. Mettier





RE: Scripting: Create a set encompassing all edges of a part
What I'm trying to to, is build an interface system between a Matlab tool and ABAQUS. The Matlab tool will provide a variable number of 2D polygons. It then writes a python script for abaqus, telling ABAQUS how to import these polygons as parts, add them to the model, mesh them etc.
I've got as far as creating the instances and meshing the individual parts. But now, because these parts are in contact with each other, I'm trying to figure out how to define the surfaces of the part in order to set up the interface criteria in ABAQUS. The interfaces will be fairly simple at first, basically a choice of frictionless or totally joined.
I thought, the best way would be to define a set for each part, consisting of all the nodes on the edges of each part, but this seems to be harder than I expected. Maybe there's another solution. I'd appreciate any hints here.
With my Set approach, I've studied the .rec file, and when I chose the edges by Hand, I contains this:
mdb.models['Model-1'].rootAssembly.Set(edges=
mdb.models['Model-1'].rootAssembly.instances['partone-1'].edges.getSequenceFromMask(
('[#f ]', ), ), name='Setone')
I assume 'getSequenceFromMask' means that if should get the info about which edges to use, from the User Interface. But if I want it scripted, that obviously won't work. I can't find anything about 'getSequenceFromMAsk' in the scripting manuals. MAybe someone could give me a headsup here?
Thanks in Advance
R.Mettier
RE: Scripting: Create a set encompassing all edges of a part
session.journalOptions.setValues(replayGeometry=COORDINATE,
recoverGeometry=COORDINATE)
This will enable you to see non-masked output in rec, rpy, and jnl files.
RE: Scripting: Create a set encompassing all edges of a part