Personal tools
You are here: Home Forum Use Select nodes/Elements by location using a script?

Select nodes/Elements by location using a script?

Up to Use

Select nodes/Elements by location using a script?

Posted by pete Halverson at February 08. 2010 19:40:57

Is it possible to select nodes/elements by location using a script? for example let's say there is a node at (100,0,0). Or an element that contains nodes 1,2,3 at locations (100,0,0) (100,1,0) (101,1,0).  I've been looking through the documentation off and on for the last couple of weeks but can't seem to sort out the TUI stuff.

 

Thanks,

 

Peter

Re: Select nodes/Elements by location using a script?

Posted by Christophe Bourcier at February 09. 2010 09:22:04

To select a node you can use:

id_node = Mesh.FindNodeClosestTo(x, y, z)

To select elements by a point coordinates:

l_id_elements = Mesh.FindElementsByPoint(x, y, z)

You can open the file SMESH/bin/salome/smeshDC.py to browse all the smesh methods. In my opinion, it's much more convenient than browsing the online help ;)

Christophe

Re: Select nodes/Elements by location using a script?

Posted by pete Halverson at February 09. 2010 15:18:42

Previously Christophe Bourcier wrote:

You can open the file SMESH/bin/salome/smeshDC.py to browse all the smesh methods. In my opinion, it's much more convenient than browsing the online help ;)


Brilliant! Absolutely brilliant!

Powered by Ploneboard
Document Actions