{"id":532,"date":"2020-05-06T21:37:15","date_gmt":"2020-05-07T04:37:15","guid":{"rendered":"http:\/\/gantovnik.com\/bio-tips\/?p=532"},"modified":"2020-05-06T21:38:53","modified_gmt":"2020-05-07T04:38:53","slug":"hwat-example","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2020\/05\/hwat-example\/","title":{"rendered":"HWAT Example"},"content":{"rendered":"<p>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:<\/p>\n<p>1) Core Function: Primarily helper functions and are not used directly in most cases. They are usually called from within other functions.<br \/>\n2) I\/O Functions: Provide assistance for working with files.<br \/>\n3) Math Functions: Provide for vector and matrix math calculations.<br \/>\n4) Solver Functions: Provide automations for solver specific operations aimed at setting up crash models.<br \/>\n5) Utility Functions: Functions for performing commonly required automations.<br \/>\n6) Widget Functions: Tk functions to create widgets.<br \/>\n7) XML Functions: Use a SAX-based parser and provide functionality for working with XML files.<\/p>\n<p>An example of a procedure that uses an HWAT command to find an angle between two vectors and return the value in a popup window:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\npackage require hwat;\r\nproc GetAngle { vect1 vect2 } {\r\n    package require hwat;\r\n\r\n    set angle &#x5B;::hwat::math::AngleBetweenVectors $vect1 $vect2];\r\n    tk_messageBox -message &quot;The angle between the vectors is $angle&quot;;\r\n}\r\n\r\nGetAngle &#x5B;list 1.0 2.0 3.0] &#x5B;list 4.0 5.0 6.0]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 Functions: Provide assistance for working [&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_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":"","jetpack_post_was_ever_published":false},"categories":[27],"tags":[],"class_list":["post-532","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-8A","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":557,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/06\/getmarkedentity-2017\/","url_meta":{"origin":532,"position":0},"title":"#80 GetMarkedEntity (2017)","author":"gantovnik","date":"2020-06-11","format":false,"excerpt":"::hwat::utils::GetMarkedEntity \"components\" 1 \"by sets\" set1 Return a list containing the IDs of the entities, 0 if no entity is found and {} if unsuccessful. If any one of the arguments is list in Tcl, like [list 1 2 3] or {1 2 3}, use eval before GetMarkedEntity command. For\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":1400,"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\/","url_meta":{"origin":532,"position":1},"title":"#267 tk_getOpenFile in tcl\/tk","author":"gantovnik","date":"2022-02-10","format":false,"excerpt":"#267 tk_getOpenFile in tcl\/tk. [code language=\"python\"] set types { {\"All Source Files\" {.tcl} } {\"Image Files\" {.txt} } {\"All files\" *} } proc doIt {label} { global types set file [tk_getOpenFile -filetypes $types -parent .] $label configure -text $file } label .l -text \"No File\" button .b -text \"Select a\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\/ex267.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":10657,"url":"https:\/\/gantovnik.com\/bio-tips\/2025\/11\/itertools-dropwhile-python-example\/","url_meta":{"origin":532,"position":2},"title":"#465 Using itertools.dropwhile in Python: Skip Values Until a Condition Fails","author":"gantovnik","date":"2025-11-04","format":false,"excerpt":"Python\u2019s itertools module provides a robust set of tools for working with iterators. One of the lesser-known but convenient functions is itertools.dropwhile(). It allows you to skip elements in an iterable as long as a specific condition remains true \u2014 and once the condition fails, it yields the rest of\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1047,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/11\/187-feet-to-meter-converter-using-python-tcl-tk\/","url_meta":{"origin":532,"position":3},"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":10734,"url":"https:\/\/gantovnik.com\/bio-tips\/2026\/04\/get-current-hypermesh-model-name-using-tcl\/","url_meta":{"origin":532,"position":4},"title":"#468 How to Get the Name of the Current Model Opened in HyperMesh Using Tcl","author":"gantovnik","date":"2026-04-30","format":false,"excerpt":"When working with Tcl scripts in HyperMesh, it is often useful to get the name of the currently opened model file. For example, you may want to automatically create output files, reports, or logs using the same name as the active HyperMesh model. HyperMesh provides the command hm_info currentfile, which\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":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":532,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/532","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=532"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/532\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}