Topics related to Lumerical and more

Importing functions from other script files?


    • Bartu Yaman

      I want to keep my function definitions in a separate file so that I can just call them in my simulation file and execute those functions to keep them clean just like how I can call "import my_file" in python and then I can use the functions with "my_file.myfunction()". Is this a thing with Lumerical scripting language? If not, this severely hinders the users ability to generate a reliable workflow with the scripting language. 

    • Amrita Pati
      Ansys Employee

      Hi Bartu,

      Yes, you can absolutely do that. You can run one script file from either another script file or the Script command. Please refer to this link for more information:Running script files. You can also create user-defined function using  the function script command Create your own Functions. We use these in many of our own workflows as well.


Viewing 1 reply thread
  • You must be logged in to reply to this topic.