🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

TCL: how to translate coordinates from a system to another?

User: "Stéphane Combet"
Altair Community Member
Updated by Stéphane Combet

Hello,

Being new to tcl, I manage to get coordinates of grid selected by user with *createmarkpanel and hm_nodevalue.

What about translating coordinates in another coordinate system? Is that implemented in a given function or should I write a script for that?

Thank you!

 

Find more posts tagged with

Sort by:
1 - 5 of 51
    User: "Michael Herve"
    Altair Employee
    Updated by Michael Herve
    Hello again @Stéphane Combet,

    Do you want to apply translation of a node selection along the axis of a user-defined system?

    If so, *translatemark request a vector. You can retrieve the command to create this vector from command.tcl.

    Then for getting the direction of the system, you may query for system attributes through hm_getvalue

    The attributes for a given entity can be retrieved in online help (search for data name) or from Matrix Browser, see below an exemple (for materials) from 6:30:

    https://youtu.be/OGRMJLunkrs?si=lW8srqNsmJUlRhBB

    Does it help?

    Michael

    User: "Stéphane Combet"
    Altair Community Member
    OP
    Updated by Stéphane Combet

    Hello again @Stéphane Combet,

    Do you want to apply translation of a node selection along the axis of a user-defined system?

    If so, *translatemark request a vector. You can retrieve the command to create this vector from command.tcl.

    Then for getting the direction of the system, you may query for system attributes through hm_getvalue

    The attributes for a given entity can be retrieved in online help (search for data name) or from Matrix Browser, see below an exemple (for materials) from 6:30:

    https://youtu.be/OGRMJLunkrs?si=lW8srqNsmJUlRhBB

    Does it help?

    Michael

    Thank you Michael,

    Not sure this helps. What I want is not to move the node. But a given node being placed at (0,0,0) in global coordinate system, if I have another rectangular system placed at (1,1,1) parallel to the global one, the coordinates of the very same node are (-1,-1,-1). 

    I wonder if there is a function to get those coordinates of a node in such another system (my case being obviously more complex with systems not parallel to global one).

    If not, I will have to code myself the formulas. Feasable, but so boring... :'(

    User: "Michael Herve"
    Altair Employee
    Updated by Michael Herve

    Thank you Michael,

    Not sure this helps. What I want is not to move the node. But a given node being placed at (0,0,0) in global coordinate system, if I have another rectangular system placed at (1,1,1) parallel to the global one, the coordinates of the very same node are (-1,-1,-1). 

    I wonder if there is a function to get those coordinates of a node in such another system (my case being obviously more complex with systems not parallel to global one).

    If not, I will have to code myself the formulas. Feasable, but so boring... :'(

    Hello again @Stéphane Combet ,

     

    if you want node coordinates in a user defined system, first you need this user system to be assigned to your nodes. This way, you can use the following command:

     

    set localX [hm_getvalue node id=$NodeId dataname=localx]

    set localY [hm_getvalue node id=$NodeId dataname=localy]

    set localZ [hm_getvalue node id=$NodeId dataname=localz]

     

    Is it what you are looking for?

     

    Best Regards,

    Michael Herve

     

    User: "Stéphane Combet"
    Altair Community Member
    OP
    Updated by Stéphane Combet

    Hello again @Stéphane Combet ,

     

    if you want node coordinates in a user defined system, first you need this user system to be assigned to your nodes. This way, you can use the following command:

     

    set localX [hm_getvalue node id=$NodeId dataname=localx]

    set localY [hm_getvalue node id=$NodeId dataname=localy]

    set localZ [hm_getvalue node id=$NodeId dataname=localz]

     

    Is it what you are looking for?

     

    Best Regards,

    Michael Herve

     

    Thank you! Ok so I could:

    1. assign the user defined system to the node
    2. use the command you gave me to obtain coordinates in user defined system
    3. re-assign previous system to the node

    I will look for a command to assign a system to a node.

    User: "Michael Herve"
    Altair Employee
    Updated by Michael Herve

    Thank you! Ok so I could:

    1. assign the user defined system to the node
    2. use the command you gave me to obtain coordinates in user defined system
    3. re-assign previous system to the node

    I will look for a command to assign a system to a node.

    Hello @Stéphane Combet ,

     

    your process is correct.

     

    You should be able to use these commands:

    *createmark nodes 1 selection_method

    *systemsetanalysis nodes 1 $systemid

     

    Then to reset you can use: 

    *createmark nodes 1 selection_method

    *systemsetanalysis nodes 1 0

     

     

    Regarding the attributes to query for local coordinates, I need to apologize, here are the correct syntax (I just tested it back this morning):

    set localX [hm_getvalue node id=$NodeId dataname=x]

    set localY [hm_getvalue node id=$NodeId dataname=y]

    set localZ [hm_getvalue node id=$NodeId dataname=z]

    or

    set LocalCoords [hm_getvalue node id=$NodeId dataname=localcoordinates]

    In this second case you get a list with x y and z coordinates.

     

    Best Regards,

    Michael