{"id":765,"date":"2020-11-02T10:38:01","date_gmt":"2020-11-02T18:38:01","guid":{"rendered":"http:\/\/gantovnik.com\/bio-tips\/?p=765"},"modified":"2020-11-02T10:38:01","modified_gmt":"2020-11-02T18:38:01","slug":"129-geometric-centroid-for-selected-entities-using-tcl-in-hypermesh","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2020\/11\/129-geometric-centroid-for-selected-entities-using-tcl-in-hypermesh\/","title":{"rendered":"#129 Geometric centroid for selected entities using tcl in HyperMesh"},"content":{"rendered":"<p>#129 Geometric centroid for selected entities using tcl in HyperMesh<\/p>\n<p>To get the centroid of all surfaces:<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n*createmark surfs 1 all\r\nhm_getcentroid surfs 1\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#129 Geometric centroid for selected entities using tcl in HyperMesh To get the centroid of all surfaces: *createmark surfs 1 all hm_getcentroid surfs 1<\/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":[24,27],"tags":[],"class_list":["post-765","post","type-post","status-publish","format-standard","hentry","category-hypermesh","category-tcl"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-cl","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":760,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/10\/127-create-rbe3-element-using-hypermesh-tcl\/","url_meta":{"origin":765,"position":0},"title":"#127 Create RBE3 element using tcl in HyperMesh","author":"gantovnik","date":"2020-10-29","format":false,"excerpt":"#127 Create RBE3 element using HyperMesh tcl To create an RBE3 element with dependent node 100 and independent nodes 101,102, and 103 with all of the nodes having all six degrees of freedom and a weight of 1.23 [code language=\"python\"] *createmark nodes 1 101 102 103 *createarray 3 123456 123456\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":763,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/11\/128-moment-of-inertia-values-for-the-selected-entities-using-tcl-in-hypermesh\/","url_meta":{"origin":765,"position":1},"title":"#128 Moment-of-inertia values for the selected entities using tcl in HyperMesh","author":"gantovnik","date":"2020-11-02","format":false,"excerpt":"#128 Moment-of-inertia values for the selected entities using tcl in HyperMesh To get the MOI for components 1-5: [code language=\"python\"] *createmark comps 1 1-5 puts [hm_getmoi comps 1] [\/code] [code language=\"python\"] *createmark elems 1 displayed puts [hm_getmoi elems 1 2 $origin_node_id 2 $local_system_id 0 0] [\/code]","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":1950,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/388-hypermesh-tcl-script-to-calculate-total-area-of-all-components\/","url_meta":{"origin":765,"position":2},"title":"#388 HyperMesh tcl script to calculate total area of all components","author":"gantovnik","date":"2023-08-15","format":false,"excerpt":"[code language=\"python\"] *createmark comps 1 \"all\" set comp_id_list [hm_getmark comps 1] set total_surf_area 0 foreach comp_id $comp_id_list { *createmark surfs 1 \"by comp id\" $comp_id set surf_id_list [hm_getmark surfs 1] foreach surf_id $surf_id_list { set surf_area [hm_getareaofsurface surfs $surf_id] puts \"The area of surface ${surf_id} is ${surf_area}\" set total_surf_area [expr\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":940,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/08\/169-measures-the-shortest-distance-between-two-entity-selections-in-tcl-hypermesh\/","url_meta":{"origin":765,"position":3},"title":"#169 Measures the shortest distance between two entity selections in HyperMesh tcl","author":"gantovnik","date":"2021-08-26","format":false,"excerpt":"#169 Measures the shortest distance between two entity selections in HyperMesh tcl To get the shortest distance between nodes 100-200 and nodes 300-400: [code language=\"python\"] *createmark nodes 1 100-200 *createmark nodes 2 300-400 hm_measureshortestdistance nodes 1 0 nodes 2 0 0 [\/code] To get the shortest distance between surface 100\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":773,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/11\/131-use-a-panel-to-create-an-ordered-list-of-entities-for-use-in-a-subsequent-command-in-tcl-in-hypermesh\/","url_meta":{"origin":765,"position":4},"title":"#131 Use a panel to create an ordered list of entities for use in a subsequent command in tcl in HyperMesh","author":"gantovnik","date":"2020-11-06","format":false,"excerpt":"#131 Use a panel to create an ordered list of entities for use in a subsequent command in tcl in HyperMesh To create a line from a user specified list of nodes: [code language=\"python\"] *createlistpanel nodes 1 \"Select nodes for the line:\" set node_list [ hm_getlist nodes 1 ]; if\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":771,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/11\/130-use-a-panel-to-add-entities-to-a-mark-in-tcl-in-hypermesh\/","url_meta":{"origin":765,"position":5},"title":"#130 Use a panel to add entities to a mark in tcl in HyperMesh","author":"gantovnik","date":"2020-11-06","format":false,"excerpt":"#130 Use a panel to add entities to a mark in tcl in HyperMesh To create a mark of elements in a panel: *createmarkpanel elems 1 \"Please select the elements\" hm_getmark elems 1 To create a mark of elements in a panel using 2D faces as the default selection mode:\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\/765","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=765"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/765\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}