Find min and MAX "X" coordinate under the y=0

FaForno
FaForno Altair Community Member
edited October 2022 in Community Q&A

Good afternoon All,

I have a surface with nodes on it.

I need to find the nodes in a component and with y=0 coordinated in order to do some operations on it.

See the image:

image

 

I am been able to identify the max X coord (node on the right) but I don't find a strategy to get the node on the right.

My actual code is:

*createmark nodes 1 "by comp" redLoad
set nodeList [ hm_getmark nodes 1 ]
*clearmark nodes 1

set maxim 1

foreach node $nodeList {
    set Xmax [ hm_getentityvalue NODES $node "x" 0 ]
        if { $Xmax > $maxim } {set maxim $Xmax}
    }
 
Could someone give me an idea :) ?
 
Thanks a lot in advance to all.
 
Regards,
FF

Answers

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited September 2022

    I would select the nodes by plane I think:

    *createmark nodes 1 "by comp" redLoad

    hm_createmark nodes 2 "on plane" "0 0 0 0 0 1 .1 1 1"

    *markintersection nodes 1 nodes 2

    set nodeList [hm_getmark nodes 1]

  • FaForno
    FaForno Altair Community Member
    edited September 2022

    Dear Ben,

    it's not working... nodeList is empty ...

     

    Fabio

  • Ben Buchanan
    Ben Buchanan
    Altair Employee
    edited September 2022
    FaForno said:

    Dear Ben,

    it's not working... nodeList is empty ...

     

    Fabio

    Oh.  I defined the plane with a normal in the z but the normal should be in the y for your model.

    hm_createmark nodes 2 "on plane" "0 0 0 0 1 0 .1 1 1"

    I defined the plane incorrectly for your model.  The first 6 numbers in the last field define the center point and the normal of the plane (0 0 0 0 0 1).  So the plane I am calling out is centered at the origin with the normal in the z direction.

    Here is the help page for hm_createmark. If you search "on plane" you should find a description of this functionality.

    https://2022.help.altair.com/2022.1/hwdesktop/hwd/topics/reference/hm/hm_createmark.htm

  • FaForno
    FaForno Altair Community Member
    edited October 2022

    Dear Ben,

    I fixed it.

    I define the plane in the right way and now it works fine.

     

    Thanks a lot for your help,

    Fabio