{"id":1315,"date":"2022-01-04T14:48:30","date_gmt":"2022-01-04T22:48:30","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=1315"},"modified":"2022-01-04T14:48:30","modified_gmt":"2022-01-04T22:48:30","slug":"133-create-vectors-and-planes-using-tcl-in-hypermesh-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\/","title":{"rendered":"#239 Dictionary iteration in tcl"},"content":{"rendered":"<p>A dictionary iteration for printing keys and values of the dictionary is<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset thicknesses &#x5B;dict create t1 0.1 t2 0.2 t3 0.25]\r\nforeach item &#x5B;dict keys $thicknesses] {\r\n  set value &#x5B;dict get $thicknesses $item]\r\n  puts $value\r\n}\r\n<\/pre>\n<p>Result:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n0.1\r\n0.2\r\n0.25\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A dictionary iteration for printing keys and values of the dictionary is set thicknesses &#x5B;dict create t1 0.1 t2 0.2 t3 0.25] foreach item &#x5B;dict keys $thicknesses] { set value &#x5B;dict get $thicknesses $item] puts $value } Result: 0.1 0.2 0.25<\/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-1315","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-ld","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1311,"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\/","url_meta":{"origin":1315,"position":0},"title":"#237 Create a dictionary in tcl","author":"gantovnik","date":"2022-01-04","format":false,"excerpt":"A dictionary is an arrangement for mapping values to keys. The syntax for the conventional dictionary is [code language=\"python\"] dict set dictname key value # or dict create dictname key1 value1 key2 value2 .. keyn valuen [\/code] Example: [code language=\"python\"] dict set thicknesses t1 0.1 puts $thicknesses dict set thicknesses\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":1321,"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\/","url_meta":{"origin":1315,"position":1},"title":"#241 Get all keys in dictionary in tcl","author":"gantovnik","date":"2022-01-04","format":false,"excerpt":"The syntax for retrieving all keys in dict is [code language=\"python\"] [dict keys $dictname] [\/code] Example: [code language=\"python\"] set thicknesses [dict create t1 0.1 t2 0.2 t3 0.25] set keys [dict keys $thicknesses] puts $keys [\/code] Result: [code language=\"python\"] t1 t2 t3 [\/code]","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":1318,"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\/","url_meta":{"origin":1315,"position":2},"title":"#240 Get a value for a key in dictionary in tcl","author":"gantovnik","date":"2022-01-04","format":false,"excerpt":"The syntax for retrieving value for a key in dict is [code language=\"python\"] [dict get $dictname $keyname] [\/code] Example: [code language=\"python\"] set thicknesses [dict create t1 0.1 t2 0.2 t3 0.25] set value [dict get $thicknesses t3] puts $value [\/code] Result: [code language=\"python\"] 0.25 [\/code]","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":1323,"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\/","url_meta":{"origin":1315,"position":3},"title":"#242 Get all values in dictionary in tcl","author":"gantovnik","date":"2022-01-04","format":false,"excerpt":"The syntax for retrieving all values in dict is [code language=\"python\"] [dict values $dictname] [\/code] Example: [code language=\"python\"] set thicknesses [dict create t1 0.1 t2 0.2 t3 0.25] set values [dict values $thicknesses] puts $values [\/code] Result: [code language=\"python\"] 0.1 0.2 0.25 [\/code]","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":1325,"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\/","url_meta":{"origin":1315,"position":4},"title":"#243 Check if a key exists in dictionary in tcl","author":"gantovnik","date":"2022-01-04","format":false,"excerpt":"The syntax for checking if a key exists in dict is [code language=\"python\"] [dict exists $dictname key1] [\/code] Example: [code language=\"python\"] set thicknesses [dict create t1 0.1 t2 0.2 t3 0.25] set result [dict exists $thicknesses t3] puts $result [\/code] Result: [code language=\"python\"] 1 [\/code]","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":1313,"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\/","url_meta":{"origin":1315,"position":5},"title":"#238 Get size of a dictionary in tcl","author":"gantovnik","date":"2022-01-04","format":false,"excerpt":"The syntax for getting size of dict is [code language=\"python\"] [dict size dictname] [\/code] Example: [code language=\"python\"] set thicknesses [dict create t1 0.1 t2 0.2] puts [dict size $thicknesses] [\/code] Result: [code language=\"python\"] 2 [\/code]","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\/1315","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=1315"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1315\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=1315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=1315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=1315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}