Selecting elements of component A at a some distance (say within 3mm) from elements of component B.

Rachit Semalty
Rachit Semalty Altair Community Member
edited May 2021 in Community Q&A

Hi all. I have a list of element IDs of the same component (say B). Now I want to select elements of other components (more than one component possible) that are at a distance of, say, within 3mm of the given elements along one particular direction (not the element normal but the direction vector is given and is the same for all elements) using TCL code. I don't know how to achieve this.

I have tried the following:

1) Find nodes of elements -> create lines of 3mm length along the given vector -> create nodes at intersection of line and surfaces (if any) and find out the new nodes created.

I thought of finding associated elements and components using nodes but it is not possible as nodes are not associated with any geometry. Now if I try to associate nodes to a surface, I need a surface ID which I don't know. So this method did not work.

2) Create boxes/blocks of no thickness and length 3mm along the given vector and find the surfaces "by block/box entity" ids. This may be done but I have thousands of elements. And I will need a loop to create a number of boxes/blocks that will slow down the process. And I don't want that.

So, I want to know if I may find surfaces or components using temporary nodes (unassociated to any geometry) created above, without knowing surface ids? Or if there is a way of creating more than one box/block simultaneously using nodes and directions on a mark? Or is there any other better way to solve the problem? As you may see my TCL knowledge is limited but I will learn more if need be so even if there is a complicated but fast way to solve the problem, please let me know.

Regards,

Rachit

Best Answer

  • Rogerio Nakano_21179
    Rogerio Nakano_21179 New Altair Community Member
    edited May 2021 Answer ✓

    Hi

    Maybe you can use

    hm_getnearbyentities

    and define the vector and radius.. pretty much selecting entities inside a cylinder.

     

    I hope this is helpful

    Regards

Answers

  • Rogerio Nakano_21179
    Rogerio Nakano_21179 New Altair Community Member
    edited May 2021 Answer ✓

    Hi

    Maybe you can use

    hm_getnearbyentities

    and define the vector and radius.. pretty much selecting entities inside a cylinder.

     

    I hope this is helpful

    Regards

  • Rachit Semalty
    Rachit Semalty Altair Community Member
    edited May 2021

    Hi

    Maybe you can use

    hm_getnearbyentities

    and define the vector and radius.. pretty much selecting entities inside a cylinder.

     

    I hope this is helpful

    Regards

    Thanks for your reply. It works for me.

    Regards,

    Rachit