🎉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

Finding element id from list of node ids

User: "Sai91"
Altair Community Member
Updated by Sai91

Greetings,

 

I would like to query element id from list of node ids.

 

I know its possible other way around. But can we ask for element id giving list of node ids which make this element ?

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "tinh"
    Altair Community Member
    Updated by tinh

    Above thread may be not what @Sai91 wants,

    Let's say, you have 4 node IDs and you're sure that there is a quad formed by those. This is a way to find the quad:

    proc findElementsFormedByNodes args { 	set NodeList [join $args] 	*createmark elems 1 "by node" {*}$NodeList 	set ElemList {} 	foreach ElemId [hm_getmark elems 1] ElemNodes [hm_getvalue elems mark=1 dataname=nodes] { 		if {[lsort $ElemNodes] == [lsort $NodeList]} { 			lappend ElemList $ElemId 		} 	} 	set ElemList }  #test *createmarkpanel nodes 1 "Select nodes of an element:" puts "element(s) with nodes [join [hm_getmark nodes 1] ,] : [findElementsFormedByNodes [hm_getmark nodes 1]]"   #other way to call findElementsFormedByNodes : set nid1 5 set nid2 24 set nid3 65 set nid4 32 findElementsFormedByNodes $nid1 $nid2 $nid3 $nid4