vipin 47 Report post Posted October 16, 2018 Hi all, Is there any direct api to select elements from a set of nodes?( For example in the image i need the highlighted elements, dont need the adjacent elements to be selected.) I tried *findmark and *createmark which are selecting the nearby elements too. Quote Share this post Link to post Share on other sites
tinh 739 Report post Posted October 17, 2018 Hi Vipin You can ignore adjacent elems *createmark nodes 1 {*}$NodeList *createmark elems 1 "by node" {*}[hm_getmark nodes 1] *createmark elems 1 reverse *appendmark elems 1 "by adjacent" *createmark elems 1 reverse Pandurang likes this Quote Share this post Link to post Share on other sites
akitoguc 8 Report post Posted October 17, 2018 Another solution you can try is the following: hm_createmark nodes 1 "by id only" $NodeList; hm_createmark nodes 1 advanced reverse; hm_createmark elems 1 "by nodes" [hm_getmark nodes 1]; hm_getmark elems 1; Pandurang likes this Quote Share this post Link to post Share on other sites
vipin 47 Report post Posted October 17, 2018 Nice trick @tinh, @akitoguc Works for me! Quote Share this post Link to post Share on other sites
Roshan Shiveshwar 8 Report post Posted October 18, 2018 Just another way to handle this.... *createmarkpanel nodes 1 "Select nodes to which the attached elements have to be determined" eval "*createmark elems 1 \"by nodes\" [hm_getmark nodes 1]" eval "*createmark nodes 2 \"by elems\" [hm_getmark elems 1]" *marknotintersection nodes 1 nodes 2 eval "*createmark elems 2 \"by nodes\" [hm_getmark nodes 1]" *markdifference elems 1 elems 2 set attached_elem_list [hm_getmark elems 1] Pandurang, vipin and tinh like this Quote Share this post Link to post Share on other sites
tinh 739 Report post Posted October 18, 2018 Oh, many ways... @vipin should test which one is the fastest Using cmd time {script} To measure time to finish a script Quote Share this post Link to post Share on other sites
vipin 47 Report post Posted October 18, 2018 @tinh Tested all methods, last one runs faster on bigger assemblies (saves around 5 sec ). Thanks again all! Pandurang and tinh like this Quote Share this post Link to post Share on other sites