How to tranform cordinates with respect to csys?

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

Hi all,

 

I have a node , say 659801 and I have coordinates as (138, 150 ,0) and coordinate system id =345

Now, I want the above coordinates with respect to some other coordinate system say, 400.

I am not able to locate HM-APIs which does this transformation?

Please suggest me a way or API to do this transformation of coordinates..

 

Regards

Gopal

 

Tagged:

Welcome!

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

Answers

  • tinh
    tinh Altair Community Member
    edited March 2018

    Hi,

    try hm_xpointlocal system_id x y z

    x y z are global coord, and system_id is a local system

    above function will return coordinate x in the local system

  • tinh
    tinh Altair Community Member
    edited May 2023

    Anyway, even if there is no available api, can you write it your self? it's just some 3x3-matrix operations.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2018

    Hi Tinh,

    I was able to do the transformation using the command suggested by you.

    First I got global x, y z using below commands

        set ngx [hm_getentityvalue nodes $node globalx 0]
        set ngy [hm_getentityvalue nodes $node globaly 0]
        set ngz [hm_getentityvalue nodes $node globalz 0]

    Then used the below command for getting coordinate with respect to local system id of need.

    set xnode [hm_xpointlocal $n_systemId $ngx $ngy $ngz]    
     set znode [hm_zpointlocal $n_systemId $ngx $ngy $ngz]    

     

    It is working perfectly..

    Thanks for your valuable suggestion.It saved a lot of time for me.

     

    Regards

    Gopal

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.