# How to select special mode by script in VarFDTD

#1

Hi,

I want to select special mode in VarFDTD by script. I use the script to set up a mode source but I don’t know how to use script to select a special mode with max effective index (not TE mode). The script can select fundamental mode (TE mode, n is not max) but it is not my desired mode.

script:

addmodesource;
#set('name','input_mode');
set('injection axis','x-axis');
set('direction','forward');
set('mode selection','User select');

#2

Dear @yisu.yang

You can use updatesourcemode(X);to select the mode of interest where X is the number of mode. This is explained in the post below: