


{"id":394514,"date":"2024-11-20T12:54:43","date_gmt":"2024-11-20T12:54:43","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/"},"modified":"2024-11-20T12:54:43","modified_gmt":"2024-11-20T12:54:43","slug":"access-geometric-parameters-using-pymechanical","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/","title":{"rendered":"Access Geometric Parameters Using PyMechanical"},"content":{"rendered":"<p>&lt;p&gt;Hello everyone,&lt;\/p&gt;&lt;p&gt;I am a PhD student and I am new to scripting in Mechanical but I already have some experience in Python. I would like to automate the simulation process of a 2D axisymmetric model using Static Structural Analysis so I am resorting to using PyMechanical by running Python scripts in Ansys Mechanical through VS Code using the ansys.mechanical.core package. I have already been able to run a full simulation through VS Dode.&lt;\/p&gt;&lt;p&gt;The geometry I am using is a Parametarized Model made in Siemens NX and has to be imported into Mechanical with the Parameter Key &#8220;PH&#8221;. The parameters can then be adjusted to vary the geometry without the need to modify the model on NX.&lt;\/p&gt;&lt;p&gt;Doing this manually on Workbench is simple:&lt;\/p&gt;&lt;p&gt;<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2024\/11\/20-11-2024-1732104847-mceclip1.png\" width=\"315\" height=\"203\" \/><img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2024\/11\/20-11-2024-1732104931-mceclip2.png\" \/>&lt;\/p&gt;&lt;p&gt;Unfortunately, I am not able to read or adjust these Parameters using scripting. I am also not even able to enter the correct Parameter Key.&lt;\/p&gt;&lt;p&gt;This is one of the attempts I made to try and incorporate the Parameters using scripting:&lt;\/p&gt;&lt;p&gt;<img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2024\/11\/20-11-2024-1732105987-mceclip3.png\" \/><img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2024\/11\/20-11-2024-1732106401-mceclip4.png\" \/>&lt;\/p&gt;&lt;p&gt;When I try to change these options manually through the GUI, I am able to apply the changes I need but the Parameter are still not displayed. How can I use scripting to detect the Geomteric Parameters and adjust them in order to rerun the simulation?&lt;\/p&gt;&lt;p&gt;&nbsp;My experiment aims to produce a very large number of simulations while varying these parameters, so doing this process manually through Workbench each time is out of the question.&lt;\/p&gt;&lt;p&gt;I highly appreciate you help in this matter as I have not been able to find any helpful resouces online.&lt;\/p&gt;&lt;p&gt;Thank you in advance&lt;\/p&gt;&lt;p&gt;&nbsp;&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-394514","topic","type-topic","status-publish","hentry","topic-tag-ansysworkbench-ansys-staticstructural","topic-tag-2d-axisymmetric","topic-tag-desingmodeler-cad-geometry-solidworks-parameters","topic-tag-python","topic-tag-python-scripts-2"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Hello everyone,I am a PhD student and I am new to scripting in Mechanical but I already have some experience in Python. I would like to automate the simulation process of a 2D axisymmetric model using Static Structural Analysis so I am resorting to using PyMechanical by running Python scripts in Ansys Mechanical through VS\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Access Geometric Parameters Using PyMechanical | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"Hello everyone,I am a PhD student and I am new to scripting in Mechanical but I already have some experience in Python. I would like to automate the simulation process of a 2D axisymmetric model using Static Structural Analysis so I am resorting to using PyMechanical by running Python scripts in Ansys Mechanical through VS\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-11-20T12:54:43+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-11-20T12:54:43+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Access Geometric Parameters Using PyMechanical | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Hello everyone,I am a PhD student and I am new to scripting in Mechanical but I already have some experience in Python. I would like to automate the simulation process of a 2D axisymmetric model using Static Structural Analysis so I am resorting to using PyMechanical by running Python scripts in Ansys Mechanical through VS\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/access-geometric-parameters-using-pymechanical\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/python\\\/#listItem\",\"name\":\"python\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/python\\\/#listItem\",\"position\":3,\"name\":\"python\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/python\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/access-geometric-parameters-using-pymechanical\\\/#listItem\",\"name\":\"Access Geometric Parameters Using PyMechanical\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/access-geometric-parameters-using-pymechanical\\\/#listItem\",\"position\":4,\"name\":\"Access Geometric Parameters Using PyMechanical\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/python\\\/#listItem\",\"name\":\"python\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/access-geometric-parameters-using-pymechanical\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/access-geometric-parameters-using-pymechanical\\\/\",\"name\":\"Access Geometric Parameters Using PyMechanical | Ansys Learning Forum\",\"description\":\"Hello everyone,I am a PhD student and I am new to scripting in Mechanical but I already have some experience in Python. I would like to automate the simulation process of a 2D axisymmetric model using Static Structural Analysis so I am resorting to using PyMechanical by running Python scripts in Ansys Mechanical through VS\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/access-geometric-parameters-using-pymechanical\\\/#breadcrumblist\"},\"datePublished\":\"2024-11-20T12:54:43+00:00\",\"dateModified\":\"2024-11-20T12:54:43+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Access Geometric Parameters Using PyMechanical | Ansys Learning Forum","description":"Hello everyone,I am a PhD student and I am new to scripting in Mechanical but I already have some experience in Python. I would like to automate the simulation process of a 2D axisymmetric model using Static Structural Analysis so I am resorting to using PyMechanical by running Python scripts in Ansys Mechanical through VS","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","position":2,"name":"Topics","item":"https:\/\/innovationspace.ansys.com\/forum\/topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/python\/#listItem","name":"python"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/python\/#listItem","position":3,"name":"python","item":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/python\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/#listItem","name":"Access Geometric Parameters Using PyMechanical"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/#listItem","position":4,"name":"Access Geometric Parameters Using PyMechanical","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/python\/#listItem","name":"python"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/","name":"Access Geometric Parameters Using PyMechanical | Ansys Learning Forum","description":"Hello everyone,I am a PhD student and I am new to scripting in Mechanical but I already have some experience in Python. I would like to automate the simulation process of a 2D axisymmetric model using Static Structural Analysis so I am resorting to using PyMechanical by running Python scripts in Ansys Mechanical through VS","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/#breadcrumblist"},"datePublished":"2024-11-20T12:54:43+00:00","dateModified":"2024-11-20T12:54:43+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"Access Geometric Parameters Using PyMechanical | Ansys Learning Forum","og:description":"Hello everyone,I am a PhD student and I am new to scripting in Mechanical but I already have some experience in Python. I would like to automate the simulation process of a 2D axisymmetric model using Static Structural Analysis so I am resorting to using PyMechanical by running Python scripts in Ansys Mechanical through VS","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/","article:published_time":"2024-11-20T12:54:43+00:00","article:modified_time":"2024-11-20T12:54:43+00:00","twitter:card":"summary_large_image","twitter:title":"Access Geometric Parameters Using PyMechanical | Ansys Learning Forum","twitter:description":"Hello everyone,I am a PhD student and I am new to scripting in Mechanical but I already have some experience in Python. I would like to automate the simulation process of a 2D axisymmetric model using Static Structural Analysis so I am resorting to using PyMechanical by running Python scripts in Ansys Mechanical through VS"},"aioseo_meta_data":{"post_id":"394514","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2025-10-19 09:22:51","updated":"2026-09-17 11:54:21","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/topics\/\" title=\"Topics\">Topics<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/python\/\" title=\"python\">python<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tAccess Geometric Parameters Using PyMechanical\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Topics","link":"https:\/\/innovationspace.ansys.com\/forum\/topics\/"},{"label":"python","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/python\/"},{"label":"Access Geometric Parameters Using PyMechanical","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/access-geometric-parameters-using-pymechanical\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["483415","58821"],"_bbp_author_ip":["141.43.131.220"],"_btv_view_count":["470"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["394514"],"_bbp_forum_id":["27791"],"_bbp_engagement":["58821","483415"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["394542"],"_bbp_last_active_id":["394542"],"_bbp_last_active_time":["2024-11-20 14:39:38"]},"test":"fathallab-tu-de"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/394514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/394514\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=394514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}