


{"id":161155,"date":"2021-08-09T18:09:25","date_gmt":"2021-08-09T18:09:25","guid":{"rendered":"\/forum\/forums\/topic\/adding-new-material-to-lumerical-via-python\/"},"modified":"2021-08-20T21:34:21","modified_gmt":"2021-08-20T21:34:21","slug":"adding-new-material-to-lumerical-via-python","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/adding-new-material-to-lumerical-via-python\/","title":{"rendered":"Adding new material to lumerical via Python"},"content":{"rendered":"<div class=\"Item-Body\">\n<div class=\"Message userContent\">\n<p>I&#039;m trying to add a new material to Lumerical using Python but I&#039;m not sure how to do this. The txt file that I have contains a 3D sampled material, so it has the wavelength and the Re and Im permittivities in x, y, z. This is what I tried to do but it doesn&#039;t work. <\/p>\n<p>newmaterial = fdtd.readdata(&quot;WS2 Bulk Dielectric Constant.txt&quot;)<\/p>\n<p>mymaterial = fdtd.addmaterial(&quot;3D Material data&quot;)<\/p>\n<p>&nbsp;&nbsp;fdtd.setmaterial(mymaterial,&quot;name&quot;,&quot;WS2 (tungsten disulfide&quot;)<\/p>\n<p>&nbsp;&nbsp;fdtd.setmaterial(&quot;WS2 (tungsten disulfide)&quot;,&quot;Import data&quot;,newmaterial)<\/p>\n<p>Any help would be appreciated.<\/p>\n","protected":false},"template":"","class_list":["post-161155","topic","type-topic","status-closed","hentry","topic-tag-lumerical","topic-tag-material","topic-tag-python","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":["2667"],"_bbp_likes_count":["0"],"_bbp_subscription":["264508","67701"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["161155"],"_bbp_forum_id":["27833"],"_bbp_engagement":["14496","30281","67701","217708","264508"],"_bbp_voice_count":["5"],"_bbp_reply_count":["5"],"_bbp_last_reply_id":["286228"],"_bbp_last_active_id":["286228"],"_bbp_last_active_time":["2023-05-29 21:01:28"]},"test":"gp1020ic-ac-uk"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/161155","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\/161155\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=161155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}