{"id":527,"date":"2020-05-06T21:22:50","date_gmt":"2020-05-07T04:22:50","guid":{"rendered":"http:\/\/gantovnik.com\/bio-tips\/?p=527"},"modified":"2020-05-06T21:31:14","modified_gmt":"2020-05-07T04:31:14","slug":"tcl-command-that-retrieves-the-x-component-of-a-force-of-id-12-defined-in-the-global-system","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2020\/05\/tcl-command-that-retrieves-the-x-component-of-a-force-of-id-12-defined-in-the-global-system\/","title":{"rendered":"Tcl commands"},"content":{"rendered":"<p>Tcl command that retrieves the x component of a force of ID 12 defined in the global system:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset force_x &#x5B;hm_getvalue loads id=12 dataname=comp1]\r\n<\/pre>\n<p>To retrieve the node that load 12 is applied to:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset node_id &#x5B;hm_getvalue loads id=12 dataname=node.id]\r\n<\/pre>\n<p>To retrieve the y coordinate of the node that load 12 is applied to:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset node_id &#x5B;hm_getvalue loads id=12 dataname=node.y]\r\n<\/pre>\n<p>To retrieve the load collector name that contains load 12:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset loadcol_name &#x5B;hm_getvalue loads id=12 dataname=collector.name]\r\n<\/pre>\n<p>There is no data name associated with a component collector to get the material name, only the material ID:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset matID &#x5B;hm_getvalue comps id=12 dataname=materialid]\r\n<\/pre>\n<p>A second command would then be required to get the name of the material with that ID:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset matName &#x5B;hm_getvalue mats id=$matID dataname=name]\r\n<\/pre>\n<p>Alternatively, the component collector has a material pointer data name. From this pointer, any valid material data name can be substituted by separating the pointer and the new data name with a period (.)<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset matName &#x5B;hm_getvalue comps id=12 dataname=material.name]\r\n<\/pre>\n<p>If a command is run on a pointer without the proper specification, HyperWorks Desktop issues the error message field statement references a pointer. <\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nset matName &#x5B;hm_getvalue comps id=12 dataname=material]\r\n<\/pre>\n<p>HyperWorks Desktop can\u2019t output the correct value because material points to a material entity that has many different printable values. To print the material name, reference the pointer as &#8220;material.name&#8221;. Again, a period separates the data name material and the data name name.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tcl command that retrieves the x component of a force of ID 12 defined in the global system: set force_x &#x5B;hm_getvalue loads id=12 dataname=comp1] To retrieve the node that load 12 is applied to: set node_id &#x5B;hm_getvalue loads id=12 dataname=node.id] To retrieve the y coordinate of the node that load 12 is applied to: set [&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-527","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-8v","jetpack_likes_enabled":true,"jetpack-related-posts":[{"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":527,"position":0},"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":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":527,"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":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":527,"position":2},"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":544,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/05\/how-to-write-a-code-to-know-certain-elements-belongs-to-which-components\/","url_meta":{"origin":527,"position":3},"title":"How to write a code to know certain elements belongs to which components ?","author":"gantovnik","date":"2020-05-12","format":false,"excerpt":"How to write a code to know certain elements belongs to which components ? set comp_id [hm_getvalue elems id=$elem_id dataname=collector.id]","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":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":527,"position":4},"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":[]},{"id":2032,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/01\/403-get-nodes-for-all-elements-in-the-fem-model-in-hypermesh-using-tcl-script\/","url_meta":{"origin":527,"position":5},"title":"#403 Get nodes for all elements in the FEM model in HyperMesh using tcl script","author":"gantovnik","date":"2024-01-13","format":false,"excerpt":"ex403.tcl [code language=\"python\"] set script_path [ file dirname [ file normalize [ info script ] ] ] puts $script_path cd $script_path pwd *createmark elems 1 all set elemList [ hm_getmark elements 1 ] *clearmark elements 1 set outfile [open \"ex403.txt\" w] foreach elem_id $elemList { # Get the list of\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\/527","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=527"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/527\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}