Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Object selection with script

Status
Not open for further replies.

DJStatics

Marine/Ocean
Sep 22, 2021
14
0
0
BE
Hi there,

I am using the statement getByBoundingBox() in my Python script to select vertices or nodes in my part. I am looking for a method of selecting vertices and nodes which are located on a specific set of faces/surfaces. I have created sets of faces in my part. At the moment I can only select all the objects of my part within the selection box I specify with getByBoundingBox(). Is there a statement I can add to my code to have getByBoundingBox() select from a single specified set? Or perhaps a different selection method? I use getByBoundingBox() to automatically select objects in certain areas of my part.

Lines I currently use together with getByBoundingBox():

p = mdb.models['model_name'].parts['part_name']
v = p.vertices
SelectedVertices = v.getByBoundingBox(xmin,ymin,zmin,xmax,ymax,zmax)







 
Replies continue below

Recommended for you

The solution is to use SetByBoolean(). This allows to get the intersection of two or multiple sets.
So create your box set and create another set with the whole face. Then use the boolean operation to get only the entities that are in the box and on the face.
 
Status
Not open for further replies.
Back
Top