{"id":1400,"date":"2022-02-10T20:16:51","date_gmt":"2022-02-11T04:16:51","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=1400"},"modified":"2022-02-10T20:16:51","modified_gmt":"2022-02-11T04:16:51","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","status":"publish","type":"post","link":"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\/","title":{"rendered":"#267 tk_getOpenFile in tcl\/tk"},"content":{"rendered":"<p>#267 tk_getOpenFile in tcl\/tk.<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset types {\r\n        {&quot;All Source Files&quot;     {.tcl}    }\r\n        {&quot;Image Files&quot;          {.txt}          }\r\n        {&quot;All files&quot;            *}\r\n}\r\n\r\nproc doIt {label} {\r\n    global types   \r\n    set file &#x5B;tk_getOpenFile -filetypes $types -parent .]\r\n    $label configure -text $file\r\n}\r\n\r\nlabel .l -text &quot;No File&quot;\r\nbutton .b -text &quot;Select a file?&quot; \\\r\n        -command &quot;doIt .l&quot;\r\n\r\ngrid .b -row 0 -column 0\r\ngrid .l -row 0 -column 1\r\n<\/pre>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/02\/ex267.png?resize=286%2C58&#038;ssl=1\" alt=\"\" width=\"286\" height=\"58\" class=\"alignnone size-full wp-image-1401\" srcset=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/02\/ex267.png?w=286&amp;ssl=1 286w, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/02\/ex267.png?resize=150%2C30&amp;ssl=1 150w\" sizes=\"(max-width: 286px) 100vw, 286px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>#267 tk_getOpenFile in tcl\/tk. set types { {&quot;All Source Files&quot; {.tcl} } {&quot;Image Files&quot; {.txt} } {&quot;All files&quot; *} } proc doIt {label} { global types set file &#x5B;tk_getOpenFile -filetypes $types -parent .] $label configure -text $file } label .l -text &quot;No File&quot; button .b -text &quot;Select a file?&quot; \\ -command &quot;doIt .l&quot; grid .b [&hellip;]<\/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-1400","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-mA","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1047,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/11\/187-feet-to-meter-converter-using-python-tcl-tk\/","url_meta":{"origin":1400,"position":0},"title":"#187 Feet to meter converter using python tcl\/tk","author":"gantovnik","date":"2021-11-07","format":false,"excerpt":"[code language=\"python\"] package require Tk wm title . \"Feet to Meters\" grid [ttk::frame .c -padding \"3 3 12 12\"] -column 0 -row 0 -sticky nwes grid columnconfigure . 0 -weight 1; grid rowconfigure . 0 -weight 1 grid [ttk::entry .c.feet -width 7 -textvariable feet] -column 2 -row 1 -sticky we\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\/2021\/11\/ex187.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1358,"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-2-2\/","url_meta":{"origin":1400,"position":1},"title":"#258 Tk example","author":"gantovnik","date":"2022-01-06","format":false,"excerpt":"Example: [code language=\"python\"] wm withdraw . set w [toplevel .t] wm title .t {Tk Code Example} set m [menu $w.menubar -tearoff 0] $m add cascade -label File -menu [menu $m.file] $m.file add command -label Quit -command exit $m add cascade -label Help -menu [menu $m.help] $m.help add command -label Index\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\/01\/2022-01-06_015252.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":785,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/11\/136-files-in-tcl\/","url_meta":{"origin":1400,"position":2},"title":"#136 Files in tcl","author":"gantovnik","date":"2020-11-12","format":false,"excerpt":"#136 Files in tcl It is possible to convert a filename to the Tcl format. Notice the curly braces around the filename so that the \\ character isn\u2019t interpreted as the escape character. [code language=\"python\"] set filename {C:\\My_files\\readme.txt}; C:\\My_files\\readme.txt file join [file nativename $filename]; C:\/My_files\/readme.txt [\/code] While not recommended, it\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":1428,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/03\/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-2-2-2-2-2-2\/","url_meta":{"origin":1400,"position":3},"title":"#274 The glob command in tcl","author":"gantovnik","date":"2022-03-16","format":false,"excerpt":"#274 The glob command in tcl glob command returns the names of the files that match a pattern. [code language=\"python\"] set files [glob *.tcl] foreach file $files { puts $file } [\/code] Output: [code language=\"python\"] ex274.tcl [\/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":532,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/05\/hwat-example\/","url_meta":{"origin":1400,"position":4},"title":"HWAT Example","author":"gantovnik","date":"2020-05-06","format":false,"excerpt":"There are 7 categories of HWAT functions, of which one is specific to Tk and the other 6 are for general Tcl usage. These categories are: 1) Core Function: Primarily helper functions and are not used directly in most cases. They are usually called from within other functions. 2) I\/O\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":1727,"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\/","url_meta":{"origin":1400,"position":5},"title":"#327 Creates nodes with coordinates from text file using HyperMesh Tcl","author":"gantovnik","date":"2022-12-14","format":false,"excerpt":"nodes.txt [code language=\"python\"] 3 10 3 1 6 0 2 7 4 8 10 9 0 2 2 6 6 10 1 5 7 5 3 3 0 8 9 1 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\/ex327.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1400","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=1400"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1400\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=1400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=1400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=1400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}