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

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Michael Herve
    Michael Herve
    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

  • Rakshith
    Rakshith New Altair Community Member

    hi i am also having an issue related to this, how to extract node coordinates with reference to user defined system, please post answer, thanks in advance.

  • Michael Herve
    Michael Herve
    Altair Employee

    Hello @Rakshith ,

    there should be datanames localx, localy and localz to get local coordinates system if a system is assigned to the node

    Does that help?

    Regards,

    Michael

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.