find attached node

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

Hello everyone,

 

I will give a element id.

 

I want to find the nodes attached to this element

and also nodes attached to nodes found in previous step 

In hyperview and probe results to all these nodes.

 

which command I can use for find attached in hyperview

 

Thank you

Answers

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited October 2018

    There is no direct command, you will have to come up with an algorithm using poIModel GetSelectionSetHandle

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2018

    If direct command not available, need to built one.

     

    I am not able to come up with logic to get find attached, 

    nothing seem conman

     

    any body have any suggestion on logic?

  • tinh
    tinh Altair Community Member
    edited October 2018

    Try finding adjacent elems and then find attached nodes of them

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2018

    I can take element id (primary element)

     

    find adjacent as tinh suggested, and find nodes attached to them.

     

    however I need nodes from adjacent element only attached to primary element given in first step, how would I filter other nodes?

  • tinh
    tinh Altair Community Member
    edited November 2018

    first take 4 nodes of primary element => store in NodeList1

    then find adjacent elems

    then find attached nodes of them => store in NodeList2

    now take nodes in NodeList2 but not in NodeList1

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2018

    first take 4 nodes of primary element => store in NodeList1

    then find adjacent elems

    then find attached nodes of them => store in NodeList2

    now take nodes in NodeList2 but not in NodeList1

     

    you did not get my question correctly, I might have mislead you somewhere.

     

    I do not want entire NodeList2, I need only nodes which are attched to NodeList1.

     

    In fact to go in more details, I need to process entire NodeList1. 

    Suppose my element id is x

    corresponding to this id x I will find attached nodes (suppose for hex element, nodes =8) node ids [1 2 3 4 5 6 7 8 ]

     

    Now for each node from above set I need to find attached node from adjacent element and find distance from it

    For node id 1 (first node from list), need to find attached nodes and find distance between node id 1 and all attached nodes

  • tinh
    tinh Altair Community Member
    edited November 2018

    OK. I see

    first find all elems attached with element x,  for example you find (e1, e2, e3, e4, e5, e6)

    now do a loop for each NodeId in ids [1 2 3 4 5 6 7 8 ] of x :

    - find which elems (e1, e2, e3, e4, e5, e6) have this NodeId, by with each element => get its nodes => and search for NodeId, if found => measure distance

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2018

    Hello everyone,

     

    I am still working on above mentioned script.

    I am stuck at following point

    Now I can get node numbers, I have two node numbers, how do I measure distance between two nodes. (I am working with poIPost AddMeasure  not able to figure out how it works)

     

    does anybody have any reference example for same?

     

    have created following codes please review

     

    I want distance between nodes 519626 and 519457

     

    ......

    ......

    client_handle GetModelHandle m [client_handle GetActiveModel]

    client_handle AddMeasure     distance

    distance Distance Between

    distance AddNode '1 519626 519457 %1'

     

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2018

    found solution on measure

     

    thank you

    :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />


     

     

    ::post::GetPostHandle post1

    ##To create a distance between measures and plot it:

    set measure_Dist [post1 AddMeasure]

    post1 GetMeasureHandle Dist $measure_Dist 

    Dist SetType 'distance between'

    set model_id 1

    Dist AddNode '$model_id 519625'

    Dist AddNode '$model_id 519457'

    ::post::Draw

    Dist GetValueList mag

    post1 RemoveMeasure $measure_Dist

    Dist ReleaseHandle

     

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2018

    Hello Everyone,

     

    found a simple way to find attached nodes

     

    with this can easily find the find attached nodes

     

                        ::post::GetActiveModelHandle m
                        
                        ##unset TempMasterElementNodes
                        
                        m GetSelectionSetHandle TempAdjMasterElementNodes [m AddSelectionSet node]
                        
                        #add all nodes attached to the current selection
                        
                        TempAdjMasterElementNodes Add 'id $kk '
                        
                        TempAdjMasterElementNodes Add 'adjacent'
                        
                        TempAdjMasterElementNodes Subtract 'id $kk '
                        
                        TempAdjMasterElementNodes GetList