{"id":1356,"date":"2022-01-06T01:23:17","date_gmt":"2022-01-06T09:23:17","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=1356"},"modified":"2022-01-06T01:23:17","modified_gmt":"2022-01-06T09:23:17","slug":"133-create-vectors-and-planes-using-tcl-in-hypermesh-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-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\/01\/133-create-vectors-and-planes-using-tcl-in-hypermesh-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2\/","title":{"rendered":"#257 For loop in tcl"},"content":{"rendered":"<p>Example:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfor {set i 0} {$i &lt; 100} {incr i} {\r\n  puts $i\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Example: for {set i 0} {$i &lt; 100} {incr i} { puts $i }<\/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":[],"class_list":["post-1356","post","type-post","status-publish","format-standard","hentry","category-tcl"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-lS","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":623,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/09\/96-for-loop-in-tcl\/","url_meta":{"origin":1356,"position":0},"title":"#96 For loop in tcl","author":"gantovnik","date":"2020-09-15","format":false,"excerpt":"#96 For loop in tcl [code language=\"python\"] for {set i 0} {$i < 10} {incr i} { puts \"I am inside first loop: $i\" } [\/code] Output: [code language=\"python\"] I am inside first loop: 0 I am inside first loop: 1 I am inside first loop: 2 I am inside\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":8057,"url":"https:\/\/gantovnik.com\/bio-tips\/2025\/02\/458-hypermesh-tcl-script-to-save-selected-node-ids-and-coordinates-to-a-csv-file\/","url_meta":{"origin":1356,"position":1},"title":"#458 HyperMesh tcl script to save selected node IDs and coordinates to a csv file","author":"gantovnik","date":"2025-02-20","format":false,"excerpt":"In this example, we create n=40 random nodes, select several of them, and save their node IDs and coordinates in a csv file. proc RandomReal {min max} { return [expr (rand()*($max-$min)+$min)] } set x_min 0.0 set x_max 20.0 set y_min 0.0 set y_max 10.0 set n 40 for {set i\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\/2025\/02\/2025-02-20_005944.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2025\/02\/2025-02-20_005944.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1353,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/01\/133-create-vectors-and-planes-using-tcl-in-hypermesh-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2-2\/","url_meta":{"origin":1356,"position":2},"title":"#256 Create a list of elements in tcl","author":"gantovnik","date":"2022-01-05","format":false,"excerpt":"Example: [code language=\"python\"] set t \"0.1 0.2 0.3\" set i 0; foreach j $t { puts \"$j is element number $i of list t\" incr i; } [\/code] Result: [code language=\"python\"] 0.1 is element number 0 of list t 0.2 is element number 1 of list t 0.3 is element\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":2017,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/01\/402-find-edge-nodes-of-mesh-and-create-node-sets-for-each-edge-using-tcl-script-in-hypermesh\/","url_meta":{"origin":1356,"position":3},"title":"#402 Find edge nodes of mesh and create node sets for each edge loop using tcl script in HyperMesh","author":"gantovnik","date":"2024-01-07","format":false,"excerpt":"Assume we have this model: The script will find all edges and create set of nodes for each edge: [code language=\"python\"] *clearmark comps 1 *clearmark elems 1 *createmark elems 1 \"by comps\" 1 # hm_getedgeloops = Returns surface and element entities of specific connection types. # looptype=2 get all closed\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\/2024\/01\/ex402_3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/01\/ex402_3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/01\/ex402_3.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1403,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/02\/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\/","url_meta":{"origin":1356,"position":4},"title":"#268 A progress indicator using tcl\/tk","author":"gantovnik","date":"2022-02-10","format":false,"excerpt":"#268 A progress indicator using tcl\/tk. [code language=\"python\"] # Create a simple progress gauge set, initially set to 0% proc gaugeCreate {win {color \"gray\"} } { frame $win canvas $win.display \\ -borderwidth 0 \\ -background white \\ -highlightthickness 0 \\ -width 200 \\ -height 20 pack $win.display -expand yes $win.display\u2026","rel":"","context":"In &quot;tcl&quot;","block_context":{"text":"tcl","link":"https:\/\/gantovnik.com\/bio-tips\/category\/tcl\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/02\/ex268.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":620,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/09\/95-while-loop-in-tcl\/","url_meta":{"origin":1356,"position":5},"title":"#95 While loop in tcl","author":"gantovnik","date":"2020-09-15","format":false,"excerpt":"#95 While loop in tcl [code language=\"python\"] set x 1 # This is a normal way to write a tcl while loop. while {$x < 5} { puts \"x is $x\" set x [expr {$x + 1}] } puts \"exited first loop with x equal to $x\\n\" [\/code] Output: [code\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":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1356","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=1356"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1356\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=1356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=1356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=1356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}