How to get node list of selected circle ?

Bhavik Sheth_21143
Bhavik Sheth_21143 Altair Community Member
edited November 2023 in Community Q&A

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

Best Answer

  • Vladimir_Gantovnik
    Vladimir_Gantovnik Altair Community Member
    edited November 2023 Answer ✓

    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!

Answers

  • Prajval_cu
    Prajval_cu
    Altair Employee
    edited August 2023

    Hi Bhavik,

     

    You can double click on the Nodes from the Model browser and  the Node brower populates the Tab to select the desired nodes and press ok.

    The selected Node list will appear on the Node Browser. ( refer the attached image)

     

    BR

    Prajval

  • AnılBurak
    AnılBurak Altair Community Member
    edited August 2023

    Hi Bhavik,

    With the "Matrix" tool, you can get a list of id, coordinate, etc. information of any entity in hyperworks. You can also get this information to "excel" by clicking on the "Excel" text. The process steps are in the video below.

    BR
    Anıl


  • Bhavik Sheth_21143
    Bhavik Sheth_21143 Altair Community Member
    edited August 2023

    Hi Bhavik,

    With the "Matrix" tool, you can get a list of id, coordinate, etc. information of any entity in hyperworks. You can also get this information to "excel" by clicking on the "Excel" text. The process steps are in the video below.

    BR
    Anıl


    Hello Anil,

    matrix browser looks good but I want to code this on hypermesh.

    Any suggestion regarding tcl command will be great help.

  • Bhavik Sheth_21143
    Bhavik Sheth_21143 Altair Community Member
    edited August 2023

    Hi Bhavik,

     

    You can double click on the Nodes from the Model browser and  the Node brower populates the Tab to select the desired nodes and press ok.

    The selected Node list will appear on the Node Browser. ( refer the attached image)

     

    BR

    Prajval

    Hi Prajval

    Any suggestion regarding tcl command will be great help.

    I want to code this in Hypermesh.

  • Kiyoshi Tsujimoto
    Kiyoshi Tsujimoto Altair Community Member
    edited August 2023

    Hello.

    Using the createmark "On Plane" selection in the Tcl macro command,
    The "On Plane" selection of *createmark allows you to select nodes on a cylindrical plane from a given set of coordinates. Is this the feature you are looking for?

    If this is what you are looking for and you need sample code, please respond. I will post the sample code later.

    best regards

  • Bhavik Sheth_21143
    Bhavik Sheth_21143 Altair Community Member
    edited October 2023

    Hello.

    Using the createmark "On Plane" selection in the Tcl macro command,
    The "On Plane" selection of *createmark allows you to select nodes on a cylindrical plane from a given set of coordinates. Is this the feature you are looking for?

    If this is what you are looking for and you need sample code, please respond. I will post the sample code later.

    best regards

    Hi,

    Yes please share the code.

    I will look into that.

  • Vladimir_Gantovnik
    Vladimir_Gantovnik Altair Community Member
    edited November 2023 Answer ✓

    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!

  • Bhavik Sheth_21143
    Bhavik Sheth_21143 Altair Community Member
    edited November 2023

    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!

    Hi @Vladimir Gantovnik, Ph.D. 

    Thank you so much for information. 

    Really it helps me a lot.