{"id":329,"date":"2025-05-22T22:26:41","date_gmt":"2025-05-22T14:26:41","guid":{"rendered":"http:\/\/www.structurevspoem.com\/?p=329"},"modified":"2025-05-22T23:45:32","modified_gmt":"2025-05-22T15:45:32","slug":"329","status":"publish","type":"post","link":"http:\/\/www.structurevspoem.com\/?p=329","title":{"rendered":"\u518d\u8bd5MidasAPI  [Try MidasAPI again]"},"content":{"rendered":"<h2>1 \u6982\u8ff0<\/h2>\n<blockquote>\n<p>\u4e0a\u6b21\u5168\u7f51\u7b2c\u4e00\u7bc7\u5206\u4eabMidasAPI\u7684\u6587\u7ae0\u88abMidas\u5de5\u4f5c\u4eba\u5458\u8f6c\u53d1\uff0c\u4e07\u5206\u611f\u6fc0\uff01\u5404\u4f4d\u7c89\u4e1d\u670b\u53cb\u4e5f\u70b9\u8d5e\u8f6c\u53d1\uff0c\u9605\u8bfb\u91cf\u4e00\u7834\u76ee\u68071900\uff0c\u5e94\u7c89\u4e1d\u670b\u53cb\u7684\u5f3a\u70c8\u8981\u6c42\uff0c\u518d\u7eed\u4e00\u7bc7python\u7248\u672c\u7684\u3002<\/p>\n<\/blockquote>\n<p>\u5b66\u4e60\u4e4b\u524d\uff0c\u53ef\u4ee5\u5148\u56de\u770b\u4e0b\u4e0a\u4e00\u7bc7\u7684Json\u8bed\u6cd5\uff0c\u540c\u65f6\u4e5f\u8981\u89e3\u51b3Python\u7684\u73af\u5883\u914d\u7f6e\u95ee\u9898\uff0c\u6211\u7528\u7684\u662fAnaconda\u81ea\u5e26\u7684request\u5305\uff0c\u6ca1\u6709\u7684\u8bdd\u53ef\u4ee5\u6309\u6587\u6863\u6765\u5b89\u88c5\u3002<\/p>\n<blockquote>\n<p>MIDAS GEN API\u4e2d\u6587\u5e2e\u52a9\u6587\u6863\uff08MIDAS \u674e\u535a\u58eb\u63d0\u4f9b\uff09\uff1a<a href=\"https:\/\/www.wolai.com\/tJGVDF5ohSANYF5BWniae4\">https:\/\/www.wolai.com\/tJGVDF5ohSANYF5BWniae4<\/a><\/p>\n<\/blockquote>\n<figure id=\"attachment_mmd_340\" class=\"wp-block-image \"><img width=\"755\" height=\"477\" src=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529113704714.png\" class=\"attachment-full size-full\" alt=\"\u25b6 \u6700\u8fd1\u7f51\u53cb\u7684\u50ac\u66f4\uff0c\u8c22\u8c22\u554a\uff0c\u4e0d\u50ac\u4e0d\u66f4\uff0c\u5b8c\u5168\u9760\u5927\u5bb6\u7684\u50ac\u66f4\u6765\u5199\" decoding=\"async\" loading=\"lazy\" srcset=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529113704714.png 755w, http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529113704714-300x190.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/figure>\n<h4>2  \u4e0a\u6b21\u57f9\u8bad\u7684\u89c6\u9891\u53caPPT<\/h4>\n<p>\u6211\u5728\u89c6\u9891\u91cc\u57fa\u672c\u8bb2\u4e86\u4e00\u904d\uff0c\u56e0\u65f6\u95f4\u6709\u9650\uff0c\u53ef\u80fd\u8fd8\u662f\u6709\u6bd4\u8f83\u591a\u672a\u8bb2\u6e05\u695a\uff0c\u6b22\u8fce\u5927\u5bb6\u7559\u8a00\u3002<\/p>\n<p>\u8fd9\u91cc\u518d\u6b21\u8bf4\u4e0bpython\u5199json\u7684\u4f18\u52bf\u3002<\/p>\n<p>\u6bd4\u5982MIDAS\u7684\u6881\u5355\u5143\u4fe1\u606f\uff0cjson\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"lang-json language-json json\">{&quot;Assign&quot; : {\n   1 : {\n        &quot;ITEMS&quot; : [\n            {\n                &quot;ID&quot;:1,\n                &quot;CONSTRAINT&quot; : &quot;1111000&quot;\n            }\n        ]\n    },\n    7 : {\n        &quot;ITEMS&quot; : [\n            {\n                &quot;ID&quot;:1,\n                &quot;CONSTRAINT&quot; : &quot;0111000&quot;\n            }\n        ]\n    }\n}}<\/code><\/pre>\n<p>\u6211\u91c7\u7528python\u6765\u5199\uff0c\u6211\u53ef\u4ee5\u76f4\u63a5\u5199\u6210\u4e0b\u9762\u8fd9\u6837\u3002<\/p>\n<pre><code class=\"lang-python language-python python\"># \u521b\u5efa\u8fb9\u754c\u6761\u4ef6\ncons_json = {&quot;Assign&quot; : {\n   1 : {\n        &quot;ITEMS&quot; : [\n            {\n                &quot;ID&quot;:1,\n                &quot;CONSTRAINT&quot; : &quot;1111000&quot;\n            }\n        ]\n    },\n    7 : {\n        &quot;ITEMS&quot; : [\n            {\n                &quot;ID&quot;:1,\n                &quot;CONSTRAINT&quot; : &quot;0111000&quot;\n            }\n        ]\n    }\n}}<\/code><\/pre>\n<p>\u53ef\u4ee5\u770b\u51fa\u51e0\u4e4e\u662f\u4e00\u6837\u7684\uff0c\u5f53\u7136python\u5bf9\u4e8e\u4ee3\u7801\u7684\u6536\u8fdb\u683c\u5f0f\u7684\u6709\u8981\u6c42\u7684\uff0c\u8fd9\u4e2a\u5012\u6ca1\u4ec0\u4e48\uff0c\u53ef\u4ee5\u6539\u52a8\u3002\u5176\u4ed6\u51e0\u4e4e\u5b8c\u5168\u4e00\u6837\u3002<\/p>\n<p>\u6240\u4ee5\u91c7\u7528python\u6765\u8fdb\u884cmidas api\u7684\u5f00\u53d1\u662f\u975e\u5e38\u9178\u723d\u7684\uff0c\u4e5f\u975e\u5e38\u5b9e\u7528\u3002<\/p>\n<h4>3  \u5148\u5199\u4e00\u4e2a\u8bf7\u6c42\u51fd\u6570<\/h4>\n<p>\u8bf7\u6c42\u51fd\u6570\u662f\u57fa\u4e8erequest\u5305\u6765\u5199\u7684\uff0c\u5177\u4f53\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"lang-python language-python python\"># -*- coding: utf-8 -*-\n&quot;&quot;&quot;\nCreated on Sat May 11 12:08:44 2024\n\n@author: idealzeng\n&gt;&gt;\u516c\u4f17\u53f7\/B\u7ad9\/\u5c0f\u7ea2\u4e66\/\u6296\u97f3 \u641c   &ldquo;\u4ee5\u8bd7\u4e3a\u7801&rdquo;\n&gt;&gt;\u7f51\u7ad9\uff1awww.structurevspoem.com\n&gt;&gt; \u5fae\u4fe1\n&quot;&quot;&quot;\n\n##\u4ee5\u4e0b\u4ee3\u7801\u5728MIDAS API\u5b98\u65b9\u6587\u6863\u548cMIDAS \u674e\u5de5\u5e2e\u52a9\u4e0b\u5b8c\u6210\uff0c\u5728\u6b64\u8868\u793a\u611f\u8c22\u3002\n##\u5f15\u5165\u7b2c\u4e09\u65b9\u5e93\n\nimport requests\nfrom requests.exceptions import JSONDecodeError, RequestException<\/code><\/pre>\n<p><font color=green>\u274frequest\u901a\u7528\u8bf7\u6c42\u51fd\u6570\u00a0<\/font>:<\/p>\n<pre><code class=\"lang-python language-python python\"># MIDAS API\u8bf7\u6c42\u7684\u51fd\u6570\ndef MidasAPI(method, command, body=None):\n    base_url = &quot;https:\/\/moa-engineers.midasit.cn:443\/gen&quot;##\u586b\u5199\u8fd9\u4e2a\u670d\u52a1\u5668\u7f51\u5740\uff0c\u5176\u4ed6\u90fd\u88ab\u5173\u95ed\u4e86\u3002\u6ce8\u610f\u4e0b\uff0c\u5982\u679c\u662frhino\u6216\u5176\u4ed6\u7a0b\u5e8f\uff0c\u9700\u8981\u6253\u5f00\u4ed6\u4eec\u7684\u8bbf\u95ee\u5916\u7f51\u7684\u7aef\u53e3\uff0c\u786e\u4fdd\u94fe\u63a5\u5916\u7f51\n    mapi_key = &quot;eyJ1ciI6InplbmdtaW5nIiwicGciOiJnZW4iLCJjbiI6ImZIRHJsTEl2UVEifQ.392b3f9b27751776b1a4e468ca702be96ad604e17e2c4300c22bd78b1ef4e507&quot;##\u5927\u5bb6\u586b\u5199\u81ea\u5df1\u7684key\n    url = base_url + command\n    headers = {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n        &quot;MAPI-Key&quot;: mapi_key\n    }\n    try:\n        if method == &quot;POST&quot;:\n            response = requests.post(url=url, headers=headers, json=body)\n        elif method == &quot;PUT&quot;:\n            response = requests.put(url=url, headers=headers, json=body)\n        elif method == &quot;GET&quot;:\n            response = requests.get(url=url, headers=headers)\n        elif method == &quot;DELETE&quot;:\n            response = requests.delete(url=url, headers=headers)\n\n        print(method, command, response.status_code)\n\n        try:\n            return response.json()\n        except JSONDecodeError:\n            print(&quot;Failed to parse JSON. Response content:&quot;)\n            print(response.text)\n            return None\n\n    except RequestException as e:\n        print(f&quot;An error occurred: {e}&quot;)\n        return None<\/code><\/pre>\n<h4>4 python\u8c03\u7528API\u5efa\u6a21<\/h4>\n<p>\u4ee3\u7801\u8fd8\u662f\u57f9\u8bad\u7684\u90a3\u4e2a\u5e73\u9762\u6841\u67b6\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n<figure id=\"attachment_mmd_341\" class=\"wp-block-image \"><img width=\"830\" height=\"274\" src=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121029367.png\" class=\"attachment-full size-full\" alt=\"\u25b6 \u8fd8\u662f\u90a3\u4e2a\u5e73\u9762\u6841\u67b6\" decoding=\"async\" loading=\"lazy\" srcset=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121029367.png 830w, http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121029367-300x99.png 300w, http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121029367-768x254.png 768w\" sizes=\"auto, (max-width: 830px) 100vw, 830px\" \/><\/figure>\n<pre><code class=\"lang-python language-python python\"># \u8bbe\u7f6e\u7ed3\u6784\u7c7b\u578b\uff0c\u4e3aXY\u5e73\u9762\u7684\nstyp_json={&quot;Assign&quot;: {\n        &quot;1&quot;: {\n            &quot;STYP&quot;: 3,#XY\u5e73\u9762\n            &quot;MASS&quot;: 1,\n            &quot;SMASS&quot;: 1,\n            &quot;bMASSOFFSET&quot;: True,\n            &quot;bSELFWEIGHT&quot;: True,\n            &quot;GRAV&quot;: 9.806,\n            &quot;TEMP&quot;: 0.0,\n            &quot;bALIGNBEAM&quot;: True,\n            &quot;bALIGNSLAB&quot;: True,\n            &quot;bROTRIGID&quot;: False\n        }\n    }}\n\n# \u5355\u4f4d\u8bbe\u7f6e\nunit_dist = &quot;M&quot;     # M, CM, MM, IN, FT\nunit_force = &quot;KN&quot;   # KN, N, KGF, TONF, LBF, KIPS\n# Input Data\n#\u786e\u5b9a\u4e00\u4e2a\u622a\u9762\u9ad8\u5ea6\uff0c\u8fd9\u4e2a\u622a\u9762\u8db3\u591f\u521a\u5ea6\u5c31\u597d\nheight : float  = 1.0\nwidth : float  = 0.8\n\n# \u6750\u6599\u6570\u636e\nmat_standard = &quot;GB50017-17(S)&quot;\nmat_grade = &quot;Q355&quot;\n# ID (integer)\nmaterial_ID : int = 1\nsection_ID : int = 1\n\n# \u5355\u4f4d\u7684json\u8bed\u53e5\nunit_json = {&quot;Assign&quot; : {\n    &quot;1&quot; : {\n        &quot;DIST&quot; : unit_dist,\n        &quot;FORCE&quot; : unit_force\n    }\n}}\n\n# \u6750\u6599\u7684json\u8bed\u53e5\nmatl_json = {&quot;Assign&quot; : {\n    material_ID : {\n        &quot;TYPE&quot; : &quot;STEEL&quot;,\n        &quot;NAME&quot; : mat_grade,\n        &quot;PARAM&quot; : [\n            {\n                &quot;P_TYPE&quot;:1,\n                &quot;STANDARD&quot; : mat_standard,\n                &quot;DB&quot; : mat_grade\n            }\n        ]\n    }\n}}\n\n#\u622a\u9762\u7684json\u8bed\u53e5\nsect_json = {&quot;Assign&quot; : {\n    section_ID : {\n        &quot;SECTTYPE&quot; : &quot;DBUSER&quot;,\n        &quot;SECT_NAME&quot; : &quot;Rect&quot;,\n        &quot;SECT_BEFORE&quot; : {\n            &quot;USE_SHEAR_DEFORM&quot; : True,\n            &quot;SHAPE&quot;: &quot;SB&quot;,\n            &quot;DATATYPE&quot;: 2,\n            &quot;SECT_I&quot;: {\n                &quot;vSIZE&quot; : [height, width]\n            }\n        }\n    }\n}}\n\n# \u8282\u70b9\u7684json\nnode_json = {&quot;Assign&quot; : {}}\nfor i, joint in enumerate(joints):\n    node_json[&quot;Assign&quot;][i+1] = {\n        &quot;X&quot; : joints[i][0],\n        &quot;Y&quot; : joints[i][1],\n        &quot;Z&quot; : 0.0\n    }\n\n# \u521b\u5efa\u5355\u5143\nelem_json = {&quot;Assign&quot; : {}}\nfor i in range(len(members)):\n    elem_json[&quot;Assign&quot;][1 + i] = {\n        &quot;TYPE&quot; : &quot;TRUSS&quot;,\n        &quot;MATL&quot; : material_ID,\n        &quot;SECT&quot; : section_ID,\n        &quot;NODE&quot; : [members[i][0], members[i][1]]\n    }\n\n# \u521b\u5efa\u8fb9\u754c\u6761\u4ef6\ncons_json = {&quot;Assign&quot; : {\n   1 : {\n        &quot;ITEMS&quot; : [\n            {\n                &quot;ID&quot;:1,\n                &quot;CONSTRAINT&quot; : &quot;1111000&quot;\n            }\n        ]\n    },\n    7 : {\n        &quot;ITEMS&quot; : [\n            {\n                &quot;ID&quot;:1,\n                &quot;CONSTRAINT&quot; : &quot;0111000&quot;\n            }\n        ]\n    }\n}}\n\n# \u521b\u5efa\u8377\u8f7d\u5de5\u51b5\nload_case_name = [&quot;DL&quot;, &quot;SIDL&quot;]\nload_case_desc = [&quot;Dead Load&quot;, &quot;Super Imposed Dead Load&quot;]\nstld_json = {&quot;Assign&quot; : {}}\nfor i in range(len(load_case_name)) :\n    stld_json[&quot;Assign&quot;][i + 1] = {\n        &quot;NAME&quot; : load_case_name[i],\n        &quot;TYPE&quot; : &quot;USER&quot;,\n        &quot;DESC&quot; : load_case_desc[i],\n    }\n\n# \u521b\u5efa\u81ea\u91cd\u8377\u8f7d\n# bodf_json = {&quot;Assign&quot; : {\n#     &quot;1&quot; : {\n#         &quot;LCNAME&quot; : load_case_name[0],\n#         &quot;GROUP_NAME&quot;: &quot;&quot;,\n#         &quot;FV&quot; :[\n#             0,\n#             0,\n#             -1\n#         ]\n#     }\n# }}\n\nload_NodeList=[2,3,4,5,6]\n\nadd_vertical_load : float = -20.0\n\n# \u65bd\u52a0\u8282\u70b9\u8377\u8f7d\ncnld_json = {&quot;Assign&quot; : {}}\nfor i in range(len(load_NodeList)) :\n    cnld_json[&quot;Assign&quot;][i + 2] = {\n        &quot;ITEMS&quot; :[\n            {\n                &quot;ID&quot; : load_NodeList[i],\n                &quot;LCNAME&quot; : load_case_name[0],\n                &quot;GROUP_NAME&quot;: &quot;&quot;,\n                &quot;FX&quot;: 0,\n                &quot;FY&quot;: add_vertical_load,\n                &quot;FZ&quot;: 0,\n                &quot;MX&quot;: 0,\n                &quot;MY&quot;: 0,\n                &quot;MZ&quot;: 0\n            }\n        ]\n    }\n\n# \u521b\u5efa\u8377\u8f7d\u5de5\u51b5\u7ec4\u5408\n# load_factor = [1.2, 1.5]\n# lcom_gen_json = {&quot;Assign&quot; : {\n#     &quot;1&quot; : {\n#         &quot;NAME&quot; : &quot;Comb1&quot;,\n#         &quot;ACTIVE&quot; : &quot;ACTIVE&quot;,\n#         &quot;iTYPE&quot; : 0,\n#         &quot;vCOMB&quot; :[\n#             {\n#                 &quot;ANAL&quot; : &quot;ST&quot;,\n#                 &quot;LCNAME&quot; : load_case_name[0],\n#                 &quot;FACTOR&quot; : load_factor[0]\n#             },\n#             {\n#                 &quot;ANAL&quot; : &quot;ST&quot;,\n#                 &quot;LCNAME&quot; : load_case_name[1],\n#                 &quot;FACTOR&quot; : load_factor[1]\n#             }\n#         ]\n#     }\n# }}\n\n# \u5177\u4f53\u7684Json\u6570\u636e\u4f20\u8f93\n##\u521b\u5efa\u4e00\u4e2a\u65b0\u7684MIDAS project\u6a21\u578b\nfile_res = MidasAPI(&quot;POST&quot;, &quot;\/doc\/new&quot;, {})\n# \u8bbe\u7f6e\u7ed3\u6784\u7c7b\u578b\nStructtype_res = MidasAPI(&quot;PUT&quot;, &quot;\/db\/styp&quot;, styp_json)\n# \u8bbe\u7f6e\u5355\u4f4d\nunit_res = MidasAPI(&quot;PUT&quot;, &quot;\/db\/unit&quot;, unit_json)\n# \u5b9a\u4e49\u6750\u6599\nmatl_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/matl&quot;, matl_json)\n# \u5b9a\u4e49\u622a\u9762\nsect_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/sect&quot;, sect_json)\n# \u5b9a\u4e49\u8282\u70b9\nnode_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/node&quot;, node_json)\n# \u5b9a\u4e49\u5355\u5143\nelem_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/elem&quot;, elem_json)\n# \u5b9a\u4e49\u7ea6\u675f\ncons_res = MidasAPI( &quot;POST&quot;, &quot;\/db\/cons&quot;, cons_json)\n# \u5b9a\u4e49\u8377\u8f7d\u5de5\u51b5\nstld_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/stld&quot;, stld_json)\n# \u5b9a\u4e49\u8377\u8f7d\nbmld_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/cnld&quot;, cnld_json)\n<\/code><\/pre>\n<h4>5 API\u8c03\u7528MIDAS GEN\u8ba1\u7b97\u53ca\u751f\u6210\u56fe\u7247<\/h4>\n<p>\u8c03\u7528\u8ba1\u7b97\u6bd4\u8f83\u7b80\u5355\uff0c\u5206\u6790\u4e4b\u524d\uff0c\u9700\u8981\u4fdd\u5b58\u6a21\u578b\u3002\u60f3\u4e00\u60f3\u7528python\u8c03\u7528python-docx\u5e93\u5199word\uff0c\u7136\u540e\u63d2\u5165\u56fe\u7247\u53ca\u56fe\u8868\uff0c\u53ef\u4ee5\u81ea\u52a8\u751f\u6210\u5206\u6790\u62a5\u544a\uff0c\u5927\u6709\u53ef\u4e3a\u3002<\/p>\n<pre><code class=\"lang-python language-python python\">## \u5206\u6790\u4e4b\u524d\uff0c\u9700\u8981\u4fdd\u5b58\u6a21\u578b\n## \u53e6\u5b58\u5230\u6307\u5b9a\u8def\u5f84\nmgbpath = &quot;E:\\\\Projects\\\\2024years\\\\20240417MidasAPI_Report\\\\Demo\\\\2D_Truss_py.mgb&quot;\n\nsaveasjson={&quot;Argument&quot;:mgbpath}\n\nsaveasMgb = MidasAPI(&quot;POST&quot;, &quot;\/doc\/saveas&quot;, saveasjson)\n\n##\u8fd0\u884c\u5206\u6790\n\nrunAnalysis = MidasAPI(&quot;POST&quot;, &quot;\/doc\/Anal&quot;, {})\n\n##\u56fe\u7247\u4fdd\u5b58\u8def\u5f84\npicpath=&quot;E:\\\\Projects\\\\2024years\\\\20240417MidasAPI_Report\\\\Demo\\\\Truss_Force.jpg&quot;\n\n##\u663e\u793a\u6746\u4ef6\u8f74\u529b\u56fe\uff0c\u5e76\u622a\u56fe\u4fdd\u5b58\u56fe\u7247\u81f3\u6307\u5b9a\u8def\u5f84\nsavePicjson ={\n    &quot;Argument&quot;: {\n        &quot;SET_MODE&quot;: &quot;post&quot;,\n        &quot;EXPORT_PATH&quot;: picpath,\n        &quot;ANGLE&quot;: {\n            &quot;HORIZONTAL&quot;: 0,\n            &quot;VERTICAL&quot;: 90\n        },\n        &quot;ACTIVE&quot;: {\n            &quot;ACTIVE_MODE&quot;: &quot;All&quot;\n        },\n        &quot;RESULT_GRAPHIC&quot;: {\n            &quot;CURRENT_MODE&quot;: &quot;truss forces&quot;,\n            &quot;LOAD_CASE_COMB&quot;: {\n                &quot;TYPE&quot;: &quot;ST&quot;,\n                &quot;NAME&quot;: &quot;DL&quot;\n            },\n            &quot;COMPONENTS&quot;: {\n                &quot;PART&quot;: &quot;total&quot;,\n                &quot;COMP&quot;: &quot;All&quot;\n            },\n            &quot;TYPE_OF_DISPLAY&quot;: {\n                &quot;CONTOUR&quot;: {\n                    &quot;OPT_CHECK&quot;: True\n                },\n                &quot;VALUES&quot;: {\n                    &quot;OPT_CHECK&quot;: True\n                },\n                &quot;LEGEND&quot;: {\n                    &quot;OPT_CHECK&quot;: True\n                },\n                &quot;DEFORM&quot;: {\n                    &quot;OPT_CHECK&quot;: True\n                }\n            }\n        }\n    }\n}\n\nrunAnalysis = MidasAPI(&quot;POST&quot;, &quot;\/view\/capture&quot;, savePicjson)<\/code><\/pre>\n<p>\u6700\u540e\u8f93\u51fa\u7ed3\u679c\u7684\u6548\u679c\u4e5f\u8fd8\u4e0d\u9519\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n<figure id=\"attachment_mmd_334\" class=\"wp-block-image \"><img width=\"965\" height=\"221\" src=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png\" class=\"attachment-full size-full\" alt=\"\u25b6 \u8f93\u51fa\u7ed3\u679c\u7684\u6548\u679c\" decoding=\"async\" loading=\"lazy\" srcset=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png 965w, http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272-300x69.png 300w, http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272-768x176.png 768w\" sizes=\"auto, (max-width: 965px) 100vw, 965px\" \/><\/figure>\n<h4>6 \u5199\u5728\u6700\u540e<\/h4>\n<p>\u751f\u547d\u7684\u610f\u4e49\u5728\u4e8e\u6298\u817e\uff0c\u5168\u7f51\u5fae\u4fe1\u516c\u4f17\u53f7\u7b2c2\u7bc7\u5173\u4e8eMIDAS API\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\u4e86\uff0c\u4e0b\u6b21\u518d\u7528\u771f\u5b9e\u6a21\u578b\u6d4b\u8bd5\u4e0b\u8fd0\u884c\u6548\u7387\u53ca\u5176\u4ed6\u597d\u73a9\u7684\u4e1c\u897f\u3002\u8fd9\u91cc\u7ed9\u8bfb\u8005\u4eec\u9053\u4e2a\u6b49\uff0c\u6700\u8fd1\u505a\u4ec0\u4e48\u90fd\u6ca1\u592a\u591a\u7cbe\u529b\uff0c\u770b\u9605\u8bfb\u91cf\u518d\u5199\u4e0b\u4e00\u7bc7\u5427\u3002<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;ENGLISH&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<h4>1 Overview<\/h4>\n<blockquote>\n<p>The first article sharing MidasAPI that I posted online was forwarded by Midas staff, for which I am extremely grateful! My dear followers also liked and shared it, and the readership exceeded the target of 1900. In response to the strong demand from my followers, I am continuing with a Python version.<\/p>\n<\/blockquote>\n<p>Before diving into the learning process, you might want to review the JSON syntax from the previous article and also address the Python environment configuration issue. I am using the request package that comes with Anaconda. If you don&#8217;t have it, you can install it according to the documentation.<\/p>\n<blockquote>\n<p>MIDAS GEN API Chinese Help Document (provided by Dr. Li of MIDAS): <a href=\"https:\/\/www.wolai.com\/tJGVDF5ohSANYF5BWniae4\">midas Gen API \u4f7f\u7528\u8bf4\u660e<\/a> <\/p>\n<\/blockquote>\n<figure id=\"attachment_mmd_340\" class=\"wp-block-image \"><img width=\"755\" height=\"477\" src=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529113704714.png\" class=\"attachment-full size-full\" alt=\"\u25b6 Thanks to the recent followers for their encouragement, I will continue writing based on your feedback\" decoding=\"async\" loading=\"lazy\" srcset=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529113704714.png 755w, http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529113704714-300x190.png 300w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/figure>\n<h4>2 Last Training&#8217;s Video and PPT<\/h4>\n<p>I basically went through it all in the video. Due to time constraints, there might still be quite a few things that were not explained clearly. I welcome everyone to leave comments.<\/p>\n<p>Here, I will reiterate the advantages of writing JSON with Python. For example, the beam element information of MIDAS is in the following JSON format:<\/p>\n<pre><code class=\"lang-json language-json json\">{\n    &quot;Assign&quot;: {\n        1: {\n            &quot;ITEMS&quot;: [\n                {\n                    &quot;ID&quot;: 1,\n                    &quot;CONSTRAINT&quot;: &quot;1111000&quot;\n                }\n            ]\n        },\n        7: {\n            &quot;ITEMS&quot;: [\n                {\n                    &quot;ID&quot;: 1,\n                    &quot;CONSTRAINT&quot;: &quot;0111000&quot;\n                }\n            ]\n        }\n    }\n}<\/code><\/pre>\n<p>With Python, I can write it directly like this:<\/p>\n<pre><code class=\"lang-python language-python python\">#Create boundary conditions\ncons_json = {\n    &quot;Assign&quot;: {\n        1: {\n            &quot;ITEMS&quot;: [\n                {\n                    &quot;ID&quot;: 1,\n                    &quot;CONSTRAINT&quot;: &quot;1111000&quot;\n                }\n            ]\n        },\n        7: {\n            &quot;ITEMS&quot;: [\n                {\n                    &quot;ID&quot;: 1,\n                    &quot;CONSTRAINT&quot;: &quot;0111000&quot;\n                }\n            ]\n        }\n    }\n}<\/code><\/pre>\n<p>It can be seen that they are almost identical. Of course, Python has requirements for code indentation, but that&#8217;s not a big issue and can be modified. Almost everything else is the same.\nSo, using Python for MIDAS API development is very enjoyable and practical.<\/p>\n<h4>3 Write a Request Function First<\/h4>\n<p>The request function is based on the request package, and the specific code is as follows:<\/p>\n<pre><code class=\"lang-python language-python python\"># -*- coding: utf-8 -*-\n&quot;&quot;&quot;\nCreated on Sat May 11 12:08:44 2024\n\n@author: idealzeng\n&gt;&gt; WeChat Official Account\/Bilibili\/Xiaohongshu\/Douyin search for &quot;Yi Shi Wei Ma&quot;\n&gt;&gt; Website: www.structurevspoem.com\n&gt;&gt; WeChat\n&quot;&quot;&quot;\n\n# The following code was completed with the help of the official MIDAS API documentation and assistance from Mr. Li of MIDAS. Thanks are due to them.\n# Import third-party libraries\n\nimport requests\nfrom requests.exceptions import JSONDecodeError, RequestException<\/code><\/pre>\n<p><font color=green>\u274fGeneral request function using requests<\/font>:<\/p>\n<pre><code># MIDAS API request function\ndef MidasAPI(method, command, body=None):\n    base_url = &quot;https:\/\/moa-engineers.midasit.cn:443\/gen&quot;  # Fill in this server address; all others are closed. Note that if you are using Rhino or other programs, you need to open their ports for external access to ensure the connection to the external network.\n    mapi_key = &quot;eyJ1ciI6InplbmdtaW5nIiwicGciOiJnZW4iLCJjbiI6ImZIRHJsTEl2UVEifQ.392b3f9b27751776b1a4e468ca702be96ad604e17e2c4300c22bd78b1ef4e507&quot;  # Fill in your own key\n    url = base_url + command\n    headers = {\n        &quot;Content-Type&quot;: &quot;application\/json&quot;,\n        &quot;MAPI-Key&quot;: mapi_key\n    }\n    try:\n        if method == &quot;POST&quot;:\n            response = requests.post(url=url, headers=headers, json=body)\n        elif method == &quot;PUT&quot;:\n            response = requests.put(url=url, headers=headers, json=body)\n        elif method == &quot;GET&quot;:\n            response = requests.get(url=url, headers=headers)\n        elif method == &quot;DELETE&quot;:\n            response = requests.delete(url=url, headers=headers)\n\n        print(method, command, response.status_code)\n\n        try:\n            return response.json()\n        except JSONDecodeError:\n            print(&quot;Failed to parse JSON. Response content:&quot;)\n            print(response.text)\n            return None\n\n    except RequestException as e:\n        print(f&quot;An error occurred: {e}&quot;)\n        return None\n<\/code><\/pre>\n<h4>4 Python API Modeling<\/h4>\n<p>The code is still the planar truss from the training, as shown in the figure below.\n<a href=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121029367.png\">http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121029367.png<\/a><\/p>\n<pre><code class=\"lang-python language-python python\"># Set the structure type to XY plane\nstyp_json = {\n    &quot;Assign&quot;: {\n        &quot;1&quot;: {\n            &quot;STYP&quot;: 3,  # XY plane\n            &quot;MASS&quot;: 1,\n            &quot;SMASS&quot;: 1,\n            &quot;bMASSOFFSET&quot;: True,\n            &quot;bSELFWEIGHT&quot;: True,\n            &quot;GRAV&quot;: 9.806,\n            &quot;TEMP&quot;: 0.0,\n            &quot;bALIGNBEAM&quot;: True,\n            &quot;bALIGNSLAB&quot;: True,\n            &quot;bROTRIGID&quot;: False\n        }\n    }\n}\n\n# Unit settings\nunit_dist = &quot;M&quot;     # M, CM, MM, IN, FT\nunit_force = &quot;KN&quot;   # KN, N, KGF, TONF, LBF, KIPS\n\n# Input Data\n# Determine a section height, which should be sufficiently rigid\nheight: float = 1.0\nwidth: float = 0.8\n\n# Material data\nmat_standard = &quot;GB50017-17(S)&quot;\nmat_grade = &quot;Q355&quot;\n# ID (integer)\nmaterial_ID: int = 1\nsection_ID: int = 1\n\n# Unit JSON statement\nunit_json = {\n    &quot;Assign&quot;: {\n        &quot;1&quot;: {\n            &quot;DIST&quot;: unit_dist,\n            &quot;FORCE&quot;: unit_force\n        }\n    }\n}\n\n# Material JSON statement\nmatl_json = {\n    &quot;Assign&quot;: {\n        material_ID: {\n            &quot;TYPE&quot;: &quot;STEEL&quot;,\n            &quot;NAME&quot;: mat_grade,\n            &quot;PARAM&quot;: [\n                {\n                    &quot;P_TYPE&quot;: 1,\n                    &quot;STANDARD&quot;: mat_standard,\n                    &quot;DB&quot;: mat_grade\n                }\n            ]\n        }\n    }\n}\n\n# Section JSON statement\nsect_json = {\n    &quot;Assign&quot;: {\n        section_ID: {\n            &quot;SECTTYPE&quot;: &quot;DBUSER&quot;,\n            &quot;SECT_NAME&quot;: &quot;Rect&quot;,\n            &quot;SECT_BEFORE&quot;: {\n                &quot;USE_SHEAR_DEFORM&quot;: True,\n                &quot;SHAPE&quot;: &quot;SB&quot;,\n                &quot;DATATYPE&quot;: 2,\n                &quot;SECT_I&quot;: {\n                    &quot;vSIZE&quot;: [height, width]\n                }\n            }\n        }\n    }\n}\n\n# Node JSON\nnode_json = {&quot;Assign&quot;: {}}\nfor i, joint in enumerate(joints):\n    node_json[&quot;Assign&quot;][i + 1] = {\n        &quot;X&quot;: joints[i][0],\n        &quot;Y&quot;: joints[i][1],\n        &quot;Z&quot;: 0.0\n    }\n\n# Create elements\nelem_json = {&quot;Assign&quot;: {}}\nfor i in range(len(members)):\n    elem_json[&quot;Assign&quot;][1 + i] = {\n        &quot;TYPE&quot;: &quot;TRUSS&quot;,\n        &quot;MATL&quot;: material_ID,\n        &quot;SECT&quot;: section_ID,\n        &quot;NODE&quot;: [members[i][0], members[i][1]]\n    }\n\n# Create boundary conditions\ncons_json = {\n    &quot;Assign&quot;: {\n        1: {\n            &quot;ITEMS&quot;: [\n                {\n                    &quot;ID&quot;: 1,\n                    &quot;CONSTRAINT&quot;: &quot;1111000&quot;\n                }\n            ]\n        },\n        7: {\n            &quot;ITEMS&quot;: [\n                {\n                    &quot;ID&quot;: 1,\n                    &quot;CONSTRAINT&quot;: &quot;0111000&quot;\n                }\n            ]\n        }\n    }\n}\n\n# Create load cases\nload_case_name = [&quot;DL&quot;, &quot;SIDL&quot;]\nload_case_desc = [&quot;Dead Load&quot;, &quot;Super Imposed Dead Load&quot;]\nstld_json = {&quot;Assign&quot;: {}}\nfor i in range(len(load_case_name)):\n    stld_json[&quot;Assign&quot;][i + 1] = {\n        &quot;NAME&quot;: load_case_name[i],\n        &quot;TYPE&quot;: &quot;USER&quot;,\n        &quot;DESC&quot;: load_case_desc[i],\n    }\n\n# Create self-weight load\n# bodf_json = {\n#     &quot;Assign&quot;: {\n#         &quot;1&quot;: {\n#             &quot;LCNAME&quot;: load_case_name[0],\n#             &quot;GROUP_NAME&quot;: &quot;&quot;,\n#             &quot;FV&quot;: [\n#                 0,\n#                 0,\n#                 -1\n#             ]\n#         }\n#     }\n# }\n\nload_NodeList = [2, 3, 4, 5, 6]\nadd_vertical_load: float = -20.0\n\n# Apply nodal loads\ncnld_json = {&quot;Assign&quot;: {}}\nfor i in range(len(load_NodeList)):\n    cnld_json[&quot;Assign&quot;][i + 2] = {\n        &quot;ITEMS&quot;: [\n            {\n                &quot;ID&quot;: load_NodeList[i],\n                &quot;LCNAME&quot;: load_case_name[0],\n                &quot;GROUP_NAME&quot;: &quot;&quot;,\n                &quot;FX&quot;: 0,\n                &quot;FY&quot;: add_vertical_load,\n                &quot;FZ&quot;: 0,\n                &quot;MX&quot;: 0,\n                &quot;MY&quot;: 0,\n                &quot;MZ&quot;: 0\n            }\n        ]\n    }\n\n# Create load case combinations\n# load_factor = [1.2, 1.5]\n# lcom_gen_json = {\n#     &quot;Assign&quot;: {\n#         &quot;1&quot;: {\n#             &quot;NAME&quot;: &quot;Comb1&quot;,\n#             &quot;ACTIVE&quot;: &quot;ACTIVE&quot;,\n#             &quot;iTYPE&quot;: 0,\n#             &quot;vCOMB&quot;: [\n#                 {\n#                     &quot;ANAL&quot;: &quot;ST&quot;,\n#                     &quot;LCNAME&quot;: load_case_name[0],\n#                     &quot;FACTOR&quot;: load_factor[0]\n#                 },\n#                 {\n#                     &quot;ANAL&quot;: &quot;ST&quot;,\n#                     &quot;LCNAME&quot;: load_case_name[1],\n#                     &quot;FACTOR&quot;: load_factor[1]\n#                 }\n#             ]\n#         }\n#     }\n# }\n\n# Specific JSON data transmission\n## Create a new MIDAS project model\nfile_res = MidasAPI(&quot;POST&quot;, &quot;\/doc\/new&quot;, {})\n# Set structure type\nStructtype_res = MidasAPI(&quot;PUT&quot;, &quot;\/db\/styp&quot;, styp_json)\n# Set units\nunit_res = MidasAPI(&quot;PUT&quot;, &quot;\/db\/unit&quot;, unit_json)\n# Define material\nmatl_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/matl&quot;, matl_json)\n# Define section\nsect_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/sect&quot;, sect_json)\n# Define nodes\nnode_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/node&quot;, node_json)\n# Define elements\nelem_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/elem&quot;, elem_json)\n# Define constraints\ncons_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/cons&quot;, cons_json)\n# Define load cases\nstld_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/stld&quot;, stld_json)\n# Define loads\nbmld_res = MidasAPI(&quot;POST&quot;, &quot;\/db\/cnld&quot;, cnld_json)\n<\/code><\/pre>\n<h5>5 API Call for MIDAS GEN Calculation and Image Generation<\/h5>\n<p>Calling the calculation is relatively straightforward. Before running the analysis, the model needs to be saved. Consider using the python-docx library to write a Word document in Python, then insert images and charts to automatically generate an analysis report. This has great potential.<\/p>\n<pre><code class=\"lang-python language-python python\">## Before running the analysis, the model needs to be saved\n## Save to a specified path\nmgbpath = &quot;E:\\\\Projects\\\\2024years\\\\20240417MidasAPI_Report\\\\Demo\\\\2D_Truss_py.mgb&quot;\n\nsaveasjson = {&quot;Argument&quot;: mgbpath}\n\nsaveasMgb = MidasAPI(&quot;POST&quot;, &quot;\/doc\/saveas&quot;, saveasjson)\n\n## Run the analysis\nrunAnalysis = MidasAPI(&quot;POST&quot;, &quot;\/doc\/Anal&quot;, {})\n\n## Image save path\npicpath = &quot;E:\\\\Projects\\\\2024years\\\\20240417MidasAPI_Report\\\\Demo\\\\Truss_Force.jpg&quot;\n\n## Display the axial force diagram of the members and save the image to the specified path\nsavePicjson = {\n    &quot;Argument&quot;: {\n        &quot;SET_MODE&quot;: &quot;post&quot;,\n        &quot;EXPORT_PATH&quot;: picpath,\n        &quot;ANGLE&quot;: {\n            &quot;HORIZONTAL&quot;: 0,\n            &quot;VERTICAL&quot;: 90\n        },\n        &quot;ACTIVE&quot;: {\n            &quot;ACTIVE_MODE&quot;: &quot;All&quot;\n        },\n        &quot;RESULT_GRAPHIC&quot;: {\n            &quot;CURRENT_MODE&quot;: &quot;truss forces&quot;,\n            &quot;LOAD_CASE_COMB&quot;: {\n                &quot;TYPE&quot;: &quot;ST&quot;,\n                &quot;NAME&quot;: &quot;DL&quot;\n            },\n            &quot;COMPONENTS&quot;: {\n                &quot;PART&quot;: &quot;total&quot;,\n                &quot;COMP&quot;: &quot;All&quot;\n            },\n            &quot;TYPE_OF_DISPLAY&quot;: {\n                &quot;CONTOUR&quot;: {\n                    &quot;OPT_CHECK&quot;: True\n                },\n                &quot;VALUES&quot;: {\n                    &quot;OPT_CHECK&quot;: True\n                },\n                &quot;LEGEND&quot;: {\n                    &quot;OPT_CHECK&quot;: True\n                },\n                &quot;DEFORM&quot;: {\n                    &quot;OPT_CHECK&quot;: True\n                }\n            }\n        }\n    }\n}\n\nrunAnalysis = MidasAPI(&quot;POST&quot;, &quot;\/view\/capture&quot;, savePicjson)\n<\/code><\/pre>\n<figure id=\"attachment_mmd_334\" class=\"wp-block-image \"><img width=\"965\" height=\"221\" src=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png\" class=\"attachment-full size-full\" alt=\"\u25b6 The final output result is also quite good, as shown in the figure\" decoding=\"async\" loading=\"lazy\" srcset=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png 965w, http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272-300x69.png 300w, http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272-768x176.png 768w\" sizes=\"auto, (max-width: 965px) 100vw, 965px\" \/><\/figure>\n<h4>6 Final Words<\/h4>\n<p>The meaning of life lies in\u6298\u817e (striving and exploring). This is the second article on MIDAS API on WeChat Public Platform. I will stop here for now. Next time, I will test the running efficiency and other interesting aspects with a real model. I apologize to my readers for not having much energy lately. I will consider writing the next article based on the readership.<\/p>","protected":false},"excerpt":{"rendered":"<p>1 \u6982\u8ff0 \u4e0a\u6b21\u5168\u7f51\u7b2c\u4e00\u7bc7\u5206\u4eabMidasAPI\u7684\u6587\u7ae0\u88abMida &#8230;<\/p>","protected":false},"author":1,"featured_media":334,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,64,32,33,35],"tags":[65],"class_list":["post-329","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-grasshopper","category-midas-api","category-programing","category-python","category-rhino","tag-midas-api"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u518d\u8bd5MidasAPI [Try MidasAPI again] - STRUCTUREVSPOEM<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.structurevspoem.com\/?p=329\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u518d\u8bd5MidasAPI [Try MidasAPI again] - STRUCTUREVSPOEM\" \/>\n<meta property=\"og:description\" content=\"1 \u6982\u8ff0 \u4e0a\u6b21\u5168\u7f51\u7b2c\u4e00\u7bc7\u5206\u4eabMidasAPI\u7684\u6587\u7ae0\u88abMida ...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.structurevspoem.com\/?p=329\" \/>\n<meta property=\"og:site_name\" content=\"STRUCTUREVSPOEM\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-22T14:26:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-22T15:45:32+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png\" \/>\n\t<meta property=\"og:image:width\" content=\"965\" \/>\n\t<meta property=\"og:image:height\" content=\"221\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329\"},\"author\":{\"name\":\"admin\",\"@id\":\"http:\/\/www.structurevspoem.com\/#\/schema\/person\/59bf442e4e4c21f6969b984b8c5bfc84\"},\"headline\":\"\u518d\u8bd5MidasAPI [Try MidasAPI again]\",\"datePublished\":\"2025-05-22T14:26:41+00:00\",\"dateModified\":\"2025-05-22T15:45:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329\"},\"wordCount\":2018,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/www.structurevspoem.com\/#\/schema\/person\/59bf442e4e4c21f6969b984b8c5bfc84\"},\"image\":{\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png\",\"keywords\":[\"midas api\"],\"articleSection\":[\"grasshopper\",\"midas api\",\"Programing\",\"python\",\"rhino\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.structurevspoem.com\/?p=329#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329\",\"url\":\"http:\/\/www.structurevspoem.com\/?p=329\",\"name\":\"\u518d\u8bd5MidasAPI [Try MidasAPI again] - STRUCTUREVSPOEM\",\"isPartOf\":{\"@id\":\"http:\/\/www.structurevspoem.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329#primaryimage\"},\"image\":{\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png\",\"datePublished\":\"2025-05-22T14:26:41+00:00\",\"dateModified\":\"2025-05-22T15:45:32+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.structurevspoem.com\/?p=329\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329#primaryimage\",\"url\":\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png\",\"contentUrl\":\"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png\",\"width\":965,\"height\":221},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.structurevspoem.com\/?p=329#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/www.structurevspoem.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u518d\u8bd5MidasAPI [Try MidasAPI again]\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.structurevspoem.com\/#website\",\"url\":\"http:\/\/www.structurevspoem.com\/\",\"name\":\"STRUCTUREVSPOEM\",\"description\":\"\u7801\u4e0e\u8bd7\uff0c\u7ed3\u6784\u4e0e\u827a\u672f\",\"publisher\":{\"@id\":\"http:\/\/www.structurevspoem.com\/#\/schema\/person\/59bf442e4e4c21f6969b984b8c5bfc84\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.structurevspoem.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/www.structurevspoem.com\/#\/schema\/person\/59bf442e4e4c21f6969b984b8c5bfc84\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.structurevspoem.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d6683a4d754e1836ca51137c3144cfb0ce071c46d677c7510cfd45a5214c8c92?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d6683a4d754e1836ca51137c3144cfb0ce071c46d677c7510cfd45a5214c8c92?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"logo\":{\"@id\":\"http:\/\/www.structurevspoem.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.structurevspoem.com\"],\"url\":\"http:\/\/www.structurevspoem.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u518d\u8bd5MidasAPI [Try MidasAPI again] - STRUCTUREVSPOEM","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.structurevspoem.com\/?p=329","og_locale":"zh_CN","og_type":"article","og_title":"\u518d\u8bd5MidasAPI [Try MidasAPI again] - STRUCTUREVSPOEM","og_description":"1 \u6982\u8ff0 \u4e0a\u6b21\u5168\u7f51\u7b2c\u4e00\u7bc7\u5206\u4eabMidasAPI\u7684\u6587\u7ae0\u88abMida ...","og_url":"http:\/\/www.structurevspoem.com\/?p=329","og_site_name":"STRUCTUREVSPOEM","article_published_time":"2025-05-22T14:26:41+00:00","article_modified_time":"2025-05-22T15:45:32+00:00","og_image":[{"width":965,"height":221,"url":"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"12 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.structurevspoem.com\/?p=329#article","isPartOf":{"@id":"http:\/\/www.structurevspoem.com\/?p=329"},"author":{"name":"admin","@id":"http:\/\/www.structurevspoem.com\/#\/schema\/person\/59bf442e4e4c21f6969b984b8c5bfc84"},"headline":"\u518d\u8bd5MidasAPI [Try MidasAPI again]","datePublished":"2025-05-22T14:26:41+00:00","dateModified":"2025-05-22T15:45:32+00:00","mainEntityOfPage":{"@id":"http:\/\/www.structurevspoem.com\/?p=329"},"wordCount":2018,"commentCount":0,"publisher":{"@id":"http:\/\/www.structurevspoem.com\/#\/schema\/person\/59bf442e4e4c21f6969b984b8c5bfc84"},"image":{"@id":"http:\/\/www.structurevspoem.com\/?p=329#primaryimage"},"thumbnailUrl":"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png","keywords":["midas api"],"articleSection":["grasshopper","midas api","Programing","python","rhino"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.structurevspoem.com\/?p=329#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.structurevspoem.com\/?p=329","url":"http:\/\/www.structurevspoem.com\/?p=329","name":"\u518d\u8bd5MidasAPI [Try MidasAPI again] - STRUCTUREVSPOEM","isPartOf":{"@id":"http:\/\/www.structurevspoem.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.structurevspoem.com\/?p=329#primaryimage"},"image":{"@id":"http:\/\/www.structurevspoem.com\/?p=329#primaryimage"},"thumbnailUrl":"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png","datePublished":"2025-05-22T14:26:41+00:00","dateModified":"2025-05-22T15:45:32+00:00","breadcrumb":{"@id":"http:\/\/www.structurevspoem.com\/?p=329#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.structurevspoem.com\/?p=329"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.structurevspoem.com\/?p=329#primaryimage","url":"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png","contentUrl":"http:\/\/www.structurevspoem.com\/wp-content\/uploads\/2025\/05\/image-20240529121123272.png","width":965,"height":221},{"@type":"BreadcrumbList","@id":"http:\/\/www.structurevspoem.com\/?p=329#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/www.structurevspoem.com\/"},{"@type":"ListItem","position":2,"name":"\u518d\u8bd5MidasAPI [Try MidasAPI again]"}]},{"@type":"WebSite","@id":"http:\/\/www.structurevspoem.com\/#website","url":"http:\/\/www.structurevspoem.com\/","name":"STRUCTUREVSPOEM","description":"\u7801\u4e0e\u8bd7\uff0c\u7ed3\u6784\u4e0e\u827a\u672f","publisher":{"@id":"http:\/\/www.structurevspoem.com\/#\/schema\/person\/59bf442e4e4c21f6969b984b8c5bfc84"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.structurevspoem.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"http:\/\/www.structurevspoem.com\/#\/schema\/person\/59bf442e4e4c21f6969b984b8c5bfc84","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.structurevspoem.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d6683a4d754e1836ca51137c3144cfb0ce071c46d677c7510cfd45a5214c8c92?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d6683a4d754e1836ca51137c3144cfb0ce071c46d677c7510cfd45a5214c8c92?s=96&d=mm&r=g","caption":"admin"},"logo":{"@id":"http:\/\/www.structurevspoem.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.structurevspoem.com"],"url":"http:\/\/www.structurevspoem.com\/?author=1"}]}},"_links":{"self":[{"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=\/wp\/v2\/posts\/329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=329"}],"version-history":[{"count":9,"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=\/wp\/v2\/posts\/329\/revisions"}],"predecessor-version":[{"id":346,"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=\/wp\/v2\/posts\/329\/revisions\/346"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=\/wp\/v2\/media\/334"}],"wp:attachment":[{"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=329"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.structurevspoem.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}