{"id":3616,"date":"2024-08-13T13:38:06","date_gmt":"2024-08-13T20:38:06","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=3616"},"modified":"2024-08-13T13:39:13","modified_gmt":"2024-08-13T20:39:13","slug":"445-hypermesh-python-script-for-renumbering-the-elements-and-nodes","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2024\/08\/445-hypermesh-python-script-for-renumbering-the-elements-and-nodes\/","title":{"rendered":"#445 HyperMesh python script for renumbering the elements and nodes"},"content":{"rendered":"<pre class=\"lang:python decode:true \" >\nimport hm\nimport hm.entities as ent\nelems = hm.Collection(model,ent.Element)\nmodel.renumbersolverid(collection=elems,start_id=1,incr_val=1,offset_val=1,offset_flag=0,reserved_1=0,reserved_2=0,reserved_3=0)\nnodes = hm.Collection(model,ent.Node)\nmodel.renumbersolverid(collection=nodes,start_id=1000,incr_val=1,offset_val=1,offset_flag=0,reserved_1=0,reserved_2=0,reserved_3=0)\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>import hm import hm.entities as ent elems = hm.Collection(model,ent.Element) model.renumbersolverid(collection=elems,start_id=1,incr_val=1,offset_val=1,offset_flag=0,reserved_1=0,reserved_2=0,reserved_3=0) nodes = hm.Collection(model,ent.Node) model.renumbersolverid(collection=nodes,start_id=1000,incr_val=1,offset_val=1,offset_flag=0,reserved_1=0,reserved_2=0,reserved_3=0)<\/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,2],"tags":[23,3],"class_list":["post-3616","post","type-post","status-publish","format-standard","hentry","category-hypermesh","category-python","tag-hypermesh","tag-python"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-Wk","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":2219,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/06\/431-hypermesh-python-script-to-create-nodes-using-coordinates-from-csv-file\/","url_meta":{"origin":3616,"position":0},"title":"#431 HyperMesh python script to create nodes using coordinates from csv file","author":"gantovnik","date":"2024-06-24","format":false,"excerpt":"Finally, I read how to write a script for HyperMesh in python. In this example, the script reads the coordinates of points from a cvs file. It feels like the python code is translated into a tcl script and then executed in HyperMesh. Because HyperMesh continues to record executed commands\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\/2024\/06\/ex431.png?resize=350%2C200&ssl=1","width":350,"height":200},"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":3616,"position":1},"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":[]},{"id":779,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/11\/133-create-vectors-and-planes-using-tcl-in-hypermesh\/","url_meta":{"origin":3616,"position":2},"title":"#133 Create vectors and planes using tcl in HyperMesh","author":"gantovnik","date":"2020-11-12","format":false,"excerpt":"#133 Create vectors and planes using tcl in HyperMesh To create a vector, and translate node 10 along this vector by 5 units: To create a plane, and reflect all displayed elements about this plane that has a normal along the x axis and\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":2017,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/01\/402-find-edge-nodes-of-mesh-and-create-node-sets-for-each-edge-using-tcl-script-in-hypermesh\/","url_meta":{"origin":3616,"position":3},"title":"#402 Find edge nodes of mesh and create node sets for each edge loop using tcl script in HyperMesh","author":"gantovnik","date":"2024-01-07","format":false,"excerpt":"Assume we have this model: The script will find all edges and create set of nodes for each edge:","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\/2024\/01\/ex402_3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/01\/ex402_3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/01\/ex402_3.png?resize=525%2C300&ssl=1 1.5x"},"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":3616,"position":4},"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 Output file: ex403.txt","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":1265,"url":"https:\/\/gantovnik.com\/bio-tips\/2021\/12\/133-create-vectors-and-planes-using-tcl-in-hypermesh-2\/","url_meta":{"origin":3616,"position":5},"title":"#227 Delete all elements using tcl in HyperMesh","author":"gantovnik","date":"2021-12-14","format":false,"excerpt":"To delete all of the elements in the model: To delete the elements 50, 51, and 52 from a database:","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\/3616","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=3616"}],"version-history":[{"count":1,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/3616\/revisions"}],"predecessor-version":[{"id":3622,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/3616\/revisions\/3622"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=3616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=3616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=3616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}