


{"id":160792,"date":"2021-07-28T20:52:19","date_gmt":"2021-07-28T20:52:19","guid":{"rendered":"\/forum\/forums\/topic\/questions-about-python-scripting-in-ansys-electronics-desktop-products\/"},"modified":"2021-08-04T12:26:15","modified_gmt":"2021-08-04T12:26:15","slug":"questions-about-python-scripting-in-ansys-electronics-desktop-products","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/questions-about-python-scripting-in-ansys-electronics-desktop-products\/","title":{"rendered":"Questions about Python Scripting in Ansys Electronics Desktop Products"},"content":{"rendered":"<div class=\"Item-Body\">\n<div class=\"Message userContent\">\n<p>Greetings all,<\/p>\n<p>I would like to use Python to interface with ANSYS Maxwell 3D to change parameters, run simulations, and acquire the simulations results. I will be running an optimization algorithm in Python so, this algorithm will need to actively change the model parameters based on the old simulation results (iterative process basically). <\/p>\n<p>Based on my current knowledge, I can go to tools and start recording a script in Python 2. Then, I can open my project and run the script which will do the same actions that I recorded. Also, I know that there is a scripting guide with a list of functions. <\/p>\n<p><\/p>\n<\/p>\n<p>However, I have the following questions:<\/p>\n<ol>\n<li>I recorded a simple .py script that changes the model&#039;s parameters values, analyzes the model, and saves some results. However, I cannot run the script since I need to install the<strong> ScriptEnv <\/strong>library (I tried to run the script I saved from the command window using the following line: &gt;&gt;python scriptname.py)<\/li>\n<li>I have installed the latest version of Python 2 (Python 2.7.18) and could not install <strong>ScriptEnv<\/strong><\/li>\n<\/ol>\n<p>The following screenshots would help illustrate my questions:<\/p>\n<div class=\"embedExternal embedImage\">\n<div class=\"embedExternal-content\">\n<a class=\"embedImage-link\" href=\"\/forum\/wp-content\/uploads\/forum-uploads\/431\/ID4FVYYS7RXX.png\" rel=\"nofollow noopener\" target=\"_blank\"><br \/>\n<img decoding=\"async\" class=\"embedImage-img\" src=\"\/forum\/wp-content\/uploads\/forum-uploads\/431\/ID4FVYYS7RXX.png\" alt=\"image.png\" \/><br \/>\n<\/a><\/p>\n","protected":false},"template":"","class_list":["post-160792","topic","type-topic","status-closed","hentry","topic-tag-ansys-maxwell","topic-tag-python-scripting"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_author_ip":[""],"_bbp_old_reply_author_name_id":["Anonymous"],"_bbp_old_is_reply_anonymous_id":["false"],"_btv_view_count":["6513"],"_bbp_likes_count":["0"],"_bbpmt_movedon":["2022-07-01 17:02:09"],"_bbpmt_movedfrom":["151970"],"_bbp_subscription":["276524","280203","280627","281828","282761","292308","296015"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["160792"],"_bbp_forum_id":["27793"],"_bbp_engagement":["28551","185571","216321","276524","292308","296015"],"_bbp_voice_count":["6"],"_bbp_reply_count":["6"],"_bbp_reply_count_hidden":["4"],"_bbp_last_reply_id":["312214"],"_bbp_last_active_id":["312214"],"_bbp_last_active_time":["2023-10-19 02:22:55"]},"test":"mabdelraziq"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/160792","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\/160792\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=160792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}