Extract node coordinate by TCL

FaForno
FaForno Altair Community Member
edited November 2023 in Community Q&A

Dear All,

I would like to extract the node coordinate of a selected node using tcl.

In the past i was using the following:

*createmarkpanel nodes 1 "select node"
    set node1 [ hm_getmark nodes 1 ]
    set xnode [ hm_getentityvalue NODES $node1creation "x" 0 ]
    set ynode [ hm_getentityvalue NODES $node1creation "y" 0 ]
    set znode [ hm_getentityvalue NODES $node1creation "z" 0 ]

with new release the hm_getentityvalue has been changed to hm_getvalue but seems that I can not extract the X, Y, Z coordinate.

I was thinking to change the previous to:

set node1 [ hm_getmark nodes 1 ]
set xnode [ hm_getvalue NODES $node1 "x" 0 ]
set ynode [ hm_getvalue NODES $node1 "y" 0 ]
set znode [ hm_getvalue NODES $node1 "z" 0 ]

but it doens't work.

Can someone help me, please?

 

Thanks a lot,

FF

Answers

  • Michael Herve_21439
    Michael Herve_21439
    Altair Employee
    edited November 2023

    Hello @FaForno 

     

    the syntax for hm_getvalue is not the same than for hm_getentityvalue, you should retrieve detailed information in the online help

     

    basically, itapplies now to all entities (there were many query commands in the past) and the syntax is

     

    hm_getvalue entity_type identifier dataname=...

    with entity type being either id=entity_id or name=entity_name or mark=entity_mark

     

    So in your case

     

     

    hm_getvalue nodes id=$node1 dataname=x

     

    Hope this helps,

    Michael

  • FaForno
    FaForno Altair Community Member
    edited November 2023

    It works perfectly!

     

    Thank you very much!

     

    Best regards,

    Fabio