Select nodes tcl

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

Hi fellows,

 

I'm creating a parametric macro which makes and mesh a bearing in an automatic way. I must add some kinematic coupling to model the balls contact so i need to select several nodes. those nodes are not easy to select.

First of all, i've selected those elements linked with this surface (Figure 1)

 

 

 

chosen nodes are the tagged ones.

 

I just want to select the inner nodes so i've been thinking about creating another set of nodes by :

*createmark nodes 1 'by sphere' $xball 0 $zball $circlemesh boundary 1 1 0

 

xball 0 zball are the ball centre corrdinates

circlemesh is the radius ro the outer circle which contains the undesired nodes.

 

So now i have 2 sets of nodes:

undesired:

488187 488386 488385 488376 488375 488374 488373 488372 488368 488336 488335 488334 488325 488324 488323 488322 488321 488317 488285 488284 488283 488274 488273 488272 488271 488270 488269 488266 488234 488202 488199 488198 488197 488196 488195 488194 488184 488183

 

and

 

sector:

488187 488198 488197 488196 488195 488194 488193 488192 488191 488190 488189 488188 488185 488184

 

I was wondering about a function that removes the repeated nodes in a new set

 

so it just remain these nodes:

488188 488193 488192 488191 488190 488189 488185

 

Thank you HW fellows

<?xml version="1.0" encoding="UTF-8"?>2016-03-02 16_34_55-Untitled_ - HyperMesh v13.jpg

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2016

    something like if i had:

     

    a=[1, 2, 3, 4, 5]

    b=[3, 4, 5, 6, 7]

     

    solution is c=[6, 7] because i just want the 'b' elements which doesn't exist in 'a'

  • tinh
    tinh Altair Community Member
    edited March 2016

    Hi

    use *markdifference nodes 1 nodes 2

    will select nodes that belong to mark#1 but not mark#2, then store those nodes again to mark#1 (use hm_getmark nodes 1 to get them)

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2016

    You are right Tinh, you definitely rock

     

    +1