Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Script to generate edge set from different CAD models 1

Status
Not open for further replies.

skr3178

Mechanical
Sep 5, 2020
34
0
0
US
Hi,
I used abaqus macro recording when defining set: by edge(20 deg). My end goal is run through the script different models/geometries which are identical in every aspect except for a few parametric values. For both models, I am using the same procedure for selecting the highlighted edges:create set from edge-by byedgeangle-20.
However, when I run it through for other geometric models, it selects an entirely different "e.getSequenceFromMask" or as I should say entirely different sets for "e.findAt" after running the commands for the similar edge

session.journalOptions.replayGeometry
session.journalOptions.setValues(replayGeometry=INDEX)

I am aware that the program has restrictions over findAt :
findAt initially uses the ACIS tolerance of 1E-6. As a result, findAt returns any edge that is at the arbitrary point specified or at a distance of less than 1E-6 from the arbitrary point.

I would appreciate if anyone can suggest how to ensure same edges are for different geometries when using the e.find at command.
 
Replies continue below

Recommended for you

Hi,
I am fairly new with scripting and this might be a novice error which I have been trying to work on for several hours.
I would like to select a vertice/node from a point closest to (0.0,5.0,0.0). Running the getclosest(coordinate=....) is preventing me from creating a set.
When I record through macro, the following command is executed
Code:
a = mdb.models['model-11'].rootAssembly
    session.viewports['Viewport: 1'].setValues(displayedObject=a)
    a = mdb.models['model-11'].rootAssembly
    v1 = a.instances['Circular_knit - 2, 3, 11-1'].vertices
    verts1 = v1.getSequenceFromMask(mask=('[#0 #10 ]', ), )
    region = a.Set(vertices=verts1, name='Set-2')
    mdb.models['model-11'].EncastreBC(name='BC-1', createStepName='Initial', 
        region=region, localCsys=None)
where
verts1 = mdb.models['model-11'].rootAssembly.instances['Circular_knit - 2, 3, 11-1'].vertices.findAt(((0.0, 5.0, 0.0),),)

Instead I am running code
Code:
a = mdb.models['model-11'].rootAssembly
v = a.instances['Circular_knit - 2, 3, 11-1'].vertices
r=v.getClosest(coordinates=((0.0,05.0,0.0),))
region = a.Set(vertices=verts1, name='Set-2')
TypeError: keyword error on vertices
I think the problem is with the type of variable being created. How to convert between data types?Any help would be appreciated.
Code:
type(r)
<type 'dict'>
type(verts1)
<type 'Sequence'>
 
I think I found the catch.
Instead of using getclosest(coordinate=....), I switched to using verts1 = v1.findAt(((0.0, 5.0, 0.0), ))
and it worked.
 
Status
Not open for further replies.
Back
Top