# Why I can't select the port group via script commands in FDTD?

Hi all.

I’m trying to add FDTD area and port groups using script commands to FDTD.
I used your KB addport (FDTD) - Script command documentations. The FDTD region added successfully and also port groups. But when I want to select the port group using command:
select("FDTD::ports");
unfortunately I can’t do it.
As a result, I can not do anymore, modify frequency points for instance:
set("monitor frequency points", 100);
The compiler will throw error below:

Warning: prompt line 4: no objects matching that name were found.

Error: prompt line 5: in set, no items are currently selected

What’s wrong with this simple commands? Is this Lumerical BUG? Or you have not updated your documentation after 2020 updates?
Here is the screenshot of the error:

Hi @bw27318,

Thank you for the question. It seems like this is an issue with the script testing feature rather than the actual script. If you look at the ports group the monitor frequency points should be set to 100, despite the error when you test the setup script.

1 Like

Hi,
I test his script, and get the same error and warning message. However,the monitor frequency points has been changed.

I agree with you.

1 Like

@Junyu_Li @kjohnson
Thanks for your answer. Yes, this is a problem with Test button; and the monitor frequency points changes correctly. This must be fixed in r4 update. Please remember to tell this problem to the developers team.
But another problem same as previous. Why setglobalsource - Script command not working?!
This will not change even by clicking on apply button:
deleteall;
addfdtd;
addport;
setglobalsource("wavelength start",900e-9);

I checked the global source properties but nothing has been changed:

I also encountered this problem.
In my experience, we can’t use script to edit global properties in model.
However, I don’t know why.

1 Like

@Junyu_Li

Thank you. I sure that there are some bugs in scripting system (like these two mentioned) and they shall be fixed in next update.

As far as I know this is not a bug. The reason you cannot use setglobalsource inside an analysis group is discussed in this post:

1 Like

@kjohnson
Thanks. Can you clear that where we can use setglobalsource exactly? If we can’t use this function inside an analysis group, so where it is applicable? We can simply use GUI to set this property and we will no longer need setglobalsource command!

The setglobalsource command can be used in a regular .lsf script file or in the script prompt. You can take a look at the online scripting course to see how to use these tools.

1 Like

@kjohnson
Thanks. Just tell the developer team about my main problem in “Test” button functionally.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.