Error in setup script output when modifying port objects
Hi, I'm trying to create my entire simulation environment within the 3D FDTD model setup script and when I go to modify the port object within the FDTD simulation object, I get an error for no objects matching that name were found. This happens for both the "select" and "setnamed" commands. Interestingly, if I execute the same command from the script prompt no errors are produced. I've also set the model setup script as a construction group however, I'm able to manipulate every other object expect for the port objects.
For context, the reason why I am not building my simulation environment (simulation of a grating coupler) using the usual method is because I've noticed a bug in using the built-in PSO function. Earlier versions of my simulation involved modifying the FDTD region span according to the changes in grating geometry; however, I noticed that as the PSO was running through the various iterations of different parameter values, the FDTD region span updated with a lag - that is to say the span for the current ith simulation is according to the (i-1) simulation values. As a result, the boundary of the FDTD region would sometimes intersect with a grating causing instability or inaccurate results.
Thank you for your time!