Selecting vertices, edges and faces within an area

Hi,

I have been searching for a while now but I can’t find any thing useful in regards to selecting vertices, edges or faces in a area of a mesh. Does anyone know something in the API or maybe a python script that will allow me say here is an area return me a list of edges in that area of this mesh…?

Thanks for any help.

The simplest (it may not be the fastest way, since it would have to touch every vertex), is to define an area, search through the vertices, checking each one’s location and then setting the ‘sel’ (selected) flag for the vertex if its in the correct area.

I would do that but there ten thousand plus vertices which i would have to search 1000 times… ouch. I know I can do it with Blender’s select tool manually but I would like to with Python.

How do you define an area ?
Is this a Rectangle from a certain point of view ?

And maybe you should describe in short, what you are intending to do or what you need this option for ?

If the area doesn’t move or change, and will be used often, you could always create a vertex group for those verticies in the area (manually probably), and then maybe just reference the group in python. I’m not sure how to do that… but I’m confident there must be an api reference to vertex groups.

You can certainly access vertex groups via python.

You could even create it via Python as well.

And maybe you should describe in short, what you are intending to do or what you need this option for ?

I am trying to create a rule based boolean add function. So for example you have mesh1 and mesh2 of which you would like to knit mesh1 into mesh2. I want to have selectable rules to describe how knitting should be done; eg Connect one vertex of mesh1 to many vertices of mesh 2 (One to many relationship) or another rule that describes a many to many relationship.

I would like to show the user the vertices that will be affected by the script by selecting them as one of the stages of the script. I think will have to come up way to iterator through the vertices and test whether they are in the affect region. I was just hoping maybe someone had done that already… oh well.

Thanks for the suggestions, I think vertices groups will be useful in my algorithm.

And maybe you should describe in short, what you are intending to do or what you need this option for ?
I am trying to create a rule based boolean add function. So for example you have mesh1 and mesh2 of which you would like to knit mesh1 into mesh2. I want to have selectable rules to describe how knitting should be done; eg Connect one vertex of mesh1 to many vertices of mesh 2 (One to many relationship) or another rule that describes a many to many relationship.

I would like to show the user the vertices that will be affected by the script by selecting them as one of the stages of the script. I think will have to come up way to iterator through the vertices and test whether they are in the affect region. I was just hoping maybe someone had done that already… oh well.

Thanks for the suggestions, I think vertices groups will be useful in my algorithm.