How to get node list of selected circle ?

User: "Bhavik Sheth_21143"
Altair Community Member
Updated by Bhavik Sheth_21143

Hello all,

As an input I have circle as show in image.

I want to get list of all nodes that comes on circle.

How to achieve this?

Any help will be great.

 

image

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Vladimir_Gantovnik"
    Altair Community Member
    Accepted Answer
    Updated by Vladimir_Gantovnik

    Hi Bhavik, If you have geometry, use this script. (If you have only mesh, you need to modify it). It will output the line number of the circle and the list of corresponding nodes:

    hm_holedetectioninit *createmark surfs 1 all hm_holedetectionsetentities surfs 1 hm_holedetectionsetholeparams hole_shape=31  hm_holedetectionfindholes 1 set n [hm_holedetectiongetnumberofholes] set line_list {} if { $n > 0 } { puts "Number of holes = $n" for {set i 0} {$i < $n} {incr i} { set line [hm_holedetectiongetholedetails $i] set line [regsub -all {\{|\}} $line ""] set words [split $line " "] set line_number [lindex $words end-1] hm_createmark nodes 1 "by lines" $line_number set ndlist [hm_getmark nodes 1] puts "line_number=$line_number: ndlist=$ndlist" } } else { puts "Holes not detected." } hm_holedetectionend

    I used this example:

    image

    This is the output of the script:

    Number of holes = 6 line_number=129: ndlist=31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 line_number=118: ndlist=71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 line_number=107: ndlist=111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 line_number=96: ndlist=151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 line_number=85: ndlist=191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 line_number=74: ndlist=231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250

    Of course, you can print it to a file or create sets of nodes. 

    Tcl is a powerful and elegant language. Good luck!