Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations JAE on being selected by the Eng-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
Joined
Sep 22, 2021
Messages
14
Location
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)







 
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.
 
Excellent! Thank you Mustaine3 for the help. I tried SetByBoolean() and it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top