{"id":1528,"date":"2022-08-16T01:21:46","date_gmt":"2022-08-16T08:21:46","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=1528"},"modified":"2022-08-16T01:21:46","modified_gmt":"2022-08-16T08:21:46","slug":"210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-2-2-2-2-2","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2022\/08\/210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-2-2-2-2-2\/","title":{"rendered":"#290 Looping with foreach in tcl"},"content":{"rendered":"<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n# Looping with foreach\r\nset numbers {1 2 3 4 5 6 7 8 9 10}\r\nforeach x $numbers {\r\nputs &quot;x = $x&quot;\r\n}\r\n\r\n#x = 1\r\n#x = 2\r\n#x = 3\r\n#x = 4\r\n#x = 5\r\n#x = 6\r\n#x = 7\r\n#x = 8\r\n#x = 9\r\n#x = 10\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># Looping with foreach set numbers {1 2 3 4 5 6 7 8 9 10} foreach x $numbers { puts &quot;x = $x&quot; } #x = 1 #x = 2 #x = 3 #x = 4 #x = 5 #x = 6 #x = 7 #x = 8 #x = 9 #x = 10<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[27],"tags":[43],"class_list":["post-1528","post","type-post","status-publish","format-standard","hentry","category-tcl","tag-tcl"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-oE","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":525,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/05\/tcl-script-that-prompts-the-user-to-select-nodes-and-displays-their-x-y-and-z-coordinates\/","url_meta":{"origin":1528,"position":0},"title":"Tcl script that prompts the user to select nodes and displays their x, y and z coordinates","author":"gantovnik","date":"2020-05-06","format":false,"excerpt":"Tcl script that prompts the user to select nodes and displays their x, y and z coordinates: [code language=\"python\"] #An example is a Tcl script that prompts the user to select nodes #and displays their x, y and z coordinates: hm_markclear nodes 1 *createmarkpanel nodes 1 set nodes [hm_getmark nodes\u2026","rel":"","context":"In &quot;tcl&quot;","block_context":{"text":"tcl","link":"https:\/\/gantovnik.com\/bio-tips\/category\/tcl\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6260,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/11\/452-save-selected-nodes-coordinates-to-csv-file-in-tcl-for-hypermesh\/","url_meta":{"origin":1528,"position":1},"title":"#452 Save selected nodes coordinates to*.csv file in tcl for HyperMesh","author":"gantovnik","date":"2024-11-26","format":false,"excerpt":"set script_path [ file dirname [ file normalize [ info script ] ] ] puts $script_path set output_file [file join $script_path \"nodes.csv\"] set file_id [open $output_file \"w\"] puts $file_id \"node_id,x,y,z\" *clearmark nodes 1 *createmarkpanel nodes 1 \"Select Nodes\" set selected_nodes [hm_getmark nodes 1] if {[llength $selected_nodes] == 0} { puts\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1530,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/08\/210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2\/","url_meta":{"origin":1528,"position":2},"title":"#291 Looping with for in tcl","author":"gantovnik","date":"2022-08-16","format":false,"excerpt":"[code language=\"python\"] # Looping with for # While x is less than 11 print out the value of x for {set x 1} {$x < 11} {incr x} { puts \"x = $x\" } #x = 1 #x = 2 #x = 3 #x = 4 #x = 5 #x\u2026","rel":"","context":"In &quot;tcl&quot;","block_context":{"text":"tcl","link":"https:\/\/gantovnik.com\/bio-tips\/category\/tcl\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1532,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/08\/210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2\/","url_meta":{"origin":1528,"position":3},"title":"#292 Looping with while in tcl","author":"gantovnik","date":"2022-08-16","format":false,"excerpt":"[code language=\"python\"] # Looping with while # While x is less than 11 print out the value of x set x 1 while {$x < 11} { puts \"x = $x\" incr x } #x = 1 #x = 2 #x = 3 #x = 4 #x = 5 #x\u2026","rel":"","context":"In &quot;tcl&quot;","block_context":{"text":"tcl","link":"https:\/\/gantovnik.com\/bio-tips\/category\/tcl\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1733,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/12\/210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-2-4-2\/","url_meta":{"origin":1528,"position":4},"title":"#328 Add labels with node coordinates using HyperMesh Tcl","author":"gantovnik","date":"2022-12-14","format":false,"excerpt":"nodes.txt [code language=\"python\"] 3.3 10 3 1.4 6 0 2.6 7 4 8.5 10 9 0.3 2 2 6.4 6 10 1.1 5 7 5.7 3 3 0.6 8 9 1.4 0 6 [\/code] create_nodes.tcl [code language=\"python\"] set script_path [ file dirname [ file normalize [ info script ] ]\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/12\/ex328.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/12\/ex328.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/12\/ex328.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":943,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/09\/170-gets-the-distance-of-the-given-point-from-the-nearest-line-with-ids-specified-as-arguments-in-hypermesh-tcl\/","url_meta":{"origin":1528,"position":5},"title":"#170 Gets the distance of the given point from the nearest line with IDs specified as arguments in HyperMesh tcl","author":"gantovnik","date":"2021-09-01","format":false,"excerpt":"#170 Gets the distance of the given point from the nearest line with IDs specified as arguments in HyperMesh tcl. To get closest to the point with coordinates (10, 20, 30) point on the line with ID 13: [code language=\"python\"] hm_getdistancefromnearestline [list 10 20 30] 13 [\/code] To get closest\u2026","rel":"","context":"In &quot;HyperMesh&quot;","block_context":{"text":"HyperMesh","link":"https:\/\/gantovnik.com\/bio-tips\/category\/hypermesh\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=1528"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1528\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=1528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=1528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=1528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}