{"id":1553,"date":"2021-12-01T10:54:10","date_gmt":"2021-12-01T10:54:10","guid":{"rendered":"https:\/\/laserphotonics.uk\/?p=1553"},"modified":"2021-12-01T10:54:12","modified_gmt":"2021-12-01T10:54:12","slug":"cst-2021-python-library","status":"publish","type":"post","link":"https:\/\/laserphotonics.uk\/?p=1553","title":{"rendered":"CST 2021 Python library"},"content":{"rendered":"\n<p><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/main.html#\">https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/main.html#<\/a><\/p>\n\n\n\n<h1>CST Python Libraries<\/h1>\n\n\n\n<p>Some features of the CST Studio Suite tools can be controlled via CST Python Libraries.<\/p>\n\n\n\n<h2>Overiew<\/h2>\n\n\n\n<p>The cst package provides a Python interface to the CST Studio Suite.<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/source\/cst.interface.html\">cst.interface<\/a>&nbsp;&#8211; Allows controlling a running CST Studio Suite.<\/li><li><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/source\/cst.results.html\">cst.results<\/a>&nbsp;&#8211; Provides access to 0D\/1D Results of a cst file.<\/li><li><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/source\/cst.eda.html\">cst.eda<\/a>&nbsp;&#8211; Provides an interface to a Printed Circuit Board (PCB).<\/li><\/ul>\n\n\n\n<h2>General Notes<\/h2>\n\n\n\n<p>Supported is Python version 3.6.<\/p>\n\n\n\n<h2>Setup<\/h2>\n\n\n\n<p>The CST Studio Suite installation comes with Python 3.6, which requires no further setup to start using it with the CST Python Libraries. However, this is just a plain Python interpreter with only the standard libraries available. You may want to use a more feature rich Python 3.6 distribution like Anaconda with the provided CST Python Libraries. To start working with the CST Python Libraries from an external Python distribution, you will have to include the directory in Python\u2019s system path.The easiest solution is to add or modify the&nbsp;<code>PYTHONPATH<\/code>&nbsp;system environment variable to include:<\/p>\n\n\n\n<ul><li>Windows:&nbsp;<code>&lt;CST_INSTALLATION_FOLDER&gt;\\CST&nbsp;STUDIO&nbsp;SUITE&nbsp;2020\\AMD64\\python_cst_libraries<\/code><\/li><li>Linux:&nbsp;<code>&lt;CST_INSTALLATION_FOLDER&gt;\/CST_STUDIO_SUITE_2020\/LinuxAMD64\/python_cst_libraries<\/code><\/li><\/ul>\n\n\n\n<p>If you have installed the CST Studio Suite in a different location, please adjust the paths above. Consult your operating system user manual on how to set environment variables.<\/p>\n\n\n\n<p>Alternatively you may modify&nbsp;<code>sys.path<\/code>&nbsp;in a running Python environment by calling:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&gt;&gt;&gt; <\/strong><strong>import<\/strong> <strong>sys<\/strong>\n<strong>&gt;&gt;&gt; <\/strong>sys.path.append(r\"&lt;PATH_TO_CST_AMD64&gt;\/python_cst_libraries\")\n<\/pre>\n\n\n\n<p>Please replace&nbsp;<code>&lt;PATH_TO_CST_AMD64&gt;<\/code>&nbsp;above with the system dependent paths indicated above (i.e. under Windows use:&nbsp;<code>&lt;CST_INSTALLATION_FOLDER&gt;\\CST&nbsp;STUDIO&nbsp;SUITE&nbsp;2020\\AMD64<\/code>).<\/p>\n\n\n\n<p>You have succesfully set up your Python environment when you are able to execute the following code without error:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&gt;&gt;&gt; <\/strong><strong>import<\/strong> <strong>cst<\/strong>\n<strong>&gt;&gt;&gt; <\/strong>print(cst.__file__) <em># should print '&lt;PATH_TO_CST_AMD64&gt;\\python_cst_libraries\\cst\\__init__.py'<\/em>\n<\/pre>\n\n\n\n<h1>Indices and Tables<\/h1>\n\n\n\n<ul><li><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/genindex.html\">Index<\/a><\/li><li><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/py-modindex.html\">Module Index<\/a><\/li><li><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/search.html\">Search Page<\/a><\/li><\/ul>\n\n\n\n<ul><li><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/genindex.html\">index<\/a><\/li><li><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/py-modindex.html\">modules<\/a>&nbsp;|<\/li><li><a href=\"https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/main.html#\">CST Python Libraries documentation<\/a>&nbsp;\u00bb<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/space.mit.edu\/RADIO\/CST_online\/Python\/main.html# CST Python Libraries Some features of the CST Studio Suite tools can be controlled via CST Python Libraries. Overiew The cst package provides a Python interface to the CST Studio Suite. cst.interface&nbsp;&#8211; Allows controlling a running CST Studio Suite. cst.results&nbsp;&#8211; Provides access to 0D\/1D Results of a cst file. cst.eda&nbsp;&#8211; Provides an interface to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=\/wp\/v2\/posts\/1553"}],"collection":[{"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1553"}],"version-history":[{"count":1,"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=\/wp\/v2\/posts\/1553\/revisions"}],"predecessor-version":[{"id":1554,"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=\/wp\/v2\/posts\/1553\/revisions\/1554"}],"wp:attachment":[{"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laserphotonics.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}