Find closest node and paste it to a fixed node in tcl

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hi everybody,

 

I have a question regarding how to find the closest node to a specific temp node and than paste to this specific node by usage of a tcl script?

Which command do I need to use?

 

thanks in advance

<?xml version="1.0" encoding="UTF-8"?>HM-Q1.PNG

Tagged:

Answers

  • tinh
    tinh Altair Community Member
    edited June 2018

    Hi,

    you can use hm_getclosestnode

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2018

    Hi tinh,

     

    thanks for your Support.

    I tried to use the command hm_getclosestnode:

     

    Temp Node Id = 97 (x=0; y=10; z=12.913)

     

    I tried to find the closest node like this:

    hm_getclosestnode 0 10 12.913 0 0

     

    Is this correct? If yes, what am I doing wrong, because HM said the closest node is the node with ID 97...

    But this is my temp node...

    In my opinion HM should have Show node ID 34 as closest node (see Picture attached)...

     

     

    <?xml version="1.0" encoding="UTF-8"?>HM-Q2.PNG

  • tinh
    tinh Altair Community Member
    edited June 2018

    Of course, hm is correct because your temp node (97) is closer to (0,10,12.9) than 34

    to find out the node #34 you have to ignore #97:

    *createmark nodes 1 97

    set node34 [hm_getclosestnode 0 10 12.9 0 1]

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2018

    Hi tinh,

     

    yes that's true!

    Actually I tried without the temp node, because I dont need the temp node at all. All I need are the coordinates and those I have.

     

    Thank you very much for your support - greetings from Germany!