IDs of attached elements

Merula_20758
Merula_20758 Altair Community Member
edited October 2020 in Community Q&A

Hey guys,

 

maybe one of you can help me completing the following task:

 

I need to know the IDs of the attached elements of elements. From a topology optimization I selected the elements:

 

 #Querry Elements set set_id [myModel AddSelectionSet element] myModel GetSelectionSetHandle elem_set $set_id elem_set Add 'contour >= $isoValue' myQuery SetSelectionSet $set_id myQuery SetQuery 'element.id element.centroid contour.value element.connectivity' myQuery WriteData $outPath/ElemsCentroid.txt

This gets me a list with ELEMENT ID, CENTROID coordinates, and the nodes associated with the element.

One way of solving my issue is to get a Node ID Element ID list. in order to find the attached elements. I really  cannot find the script to do this, as there is no node.connectivity query option.

 

Thanks in advance and best regards,

Merula

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2016

    Hi Merula,

     

    You can get the ID's of attached elements using the *findmark command. Here's a little test script I wrote as an example:

     # Create element set for test run *createmarkpanel elems 1 'Select Elements' set elemsOriginal [ hm_getmark elems 1 ]; *clearmark elems 1   # Find attached elements  hm_createmark elems 1 'by id' '$elemsOriginal' *findmark elements 1 1 1 elements 0 2 set elemsAttached [ hm_getmark elems 2 ]; *clearmark elems 1 *clearmark elems 2  puts 'The attached elements are $elemsAttached'

     

  • Merula_20758
    Merula_20758 Altair Community Member
    edited April 2016

    Hi MattM,

    I am sure this works in Hypermesh, but how can I run it in Hyperview?

     

    Thanks in advance,

     

    Merula